Search code examples
cakephppaginationpaginator

Why doesnt paginator remember my custom parameters when I go to page 2?


When using the paginator helper in cakephp views, it doesnt remember parts of the url that are custom for my useage.

For example:

http://example.org/users/index/moderators/page:2/sort:name/dir:asc

here moderators is a parameter that helps me filter by that type. But pressing a paginator link will not include this link.


Solution

  • To add to Alexander Morland's answer above, it's worth remembering that the syntax has changed in CakePHP 1.3 and is now:

    $this->Paginator->options(array('url' => $this->passedArgs));
    

    This is described further in the pagination in views section of the CakePHP book.