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.
The secret is adding this line to your view:
$paginator->options(array('url'=>$this->passedArgs));
(I created this question and answer because it is a much asked question and I keep having to dig out the answer since i cant remember it.)
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With