Passing GET parameters to CakePHP’s paginator

I had an issue where I had a search page which relied on GET parameters. When I added CakePHP’s pagination, the paginator did not pass along my GET variables.

Here’s my solution:

$urlParams = $this->params['url'];
$this->Paginator->options(array('url' => array('?' => http_build_query($urlParams))));

Leave a Reply

Your email address will not be published. Required fields are marked *