开发者

How can I set the paginator page from within the controller in cakePHP

开发者 https://www.devze.com 2023-04-11 00:31 出处:网络
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 gre

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号