Search code examples
cakephppaginator

cakephp Paginator has lost the current page when return from a view


I have the paginator working perfect with my view to generate a page view for items. However when you are on let's say page [8] and you visit on of the items and return to the list view the paginator start from page 1 instead of returning to the last page[8] I have searched high and low in how to get this fixed but no result, am I doing something wrong? Is there an easy fix/solution?


Solution

  • Nothing is wrong, this is the expected behaviour. Cake won't try to remember what page you were up to.

    There is an easy solution - just store the last accessed page number in the session, and then you can get it again when needed.

    The Pagination Recall Component should do what you want.