How can I set the paginator page from within the controller in cakePHP
I have a standard cakePHP backend but I'm not using the cake pagination helper. My existing frontend provides pagination params in the form "startIndex, numberOfResults" vs. "page". It would be great if from within the controller action I could just parse my startIndex, numberOfResults params, calc the proper page and then do something like:
paginate['page'] = $pageNumber;
before the paginate() call. No such luck. So my question is, how can I set the paginator page from within the cont开发者_运维问答roller? As a bonus: Where is cake parsing the page named param? Where does it store the page value used for the paginate call?
Since It's a 1.2 application. You should try changing $this->params['url']['page']
like this:
$this->params['url']['page'] = $pageNumber;
Source: CakePHP 1.2
精彩评论