I have a problem with the pagination in my search page.
When a user search something I have a url like domain.com/search/?s=keyword
but paginator gives me links lik
use statement in your view for pass parameters while pagination
$paginator->options(array('url' => $this->passedArgs));
this is simplest way to pass parameters.
Some time $this->passedArgs
not working at that time pass static value at there and try with that static value.
$paginator->options(array('url' => array('a', 'b')));
Check this comment.
I used it, it works fine.
in app_controller file:
function _paginatorURL() {
$passed = "";
$retain = $this->params['url'];
unset($retain['url']);
$this->set('paginatorURL',array($passed, '?' => http_build_query($retain)));
}
function beforeFilter()
{
$this->_paginatorURL();
}
in views file:
<?php $paginator->options = array( 'url' => $paginatorURL );?>
Hope it helps.