开发者

Multiple model pagination in one view with cakephp

I have two models. I want to paginate them in one view. The problem is that when I go to the next page of one model, for example Post,开发者_运维百科 the other model (Comment), also goes to the next page.


i guess the ticket is still not resolved: http://cakephp.lighthouseapp.com/projects/42648/tickets/102-support-for-multiple-pagination

but the link in this ticket might help: http://debuggable.com/posts/how-to-have-multiple-paginated-widgets-on-the-same-page-with-cakephp:48ad241e-b018-4532-a748-0ec74834cda3


It sounds like a challenge.

In the controller, exists a var called paginate, this var collects all the information required from the URL. Based on these parameters when you use the function paginate you get the selected records from the model.

In the same controller you have only one paginate var.

Can you specify your problem? What is the expected performance in your case?

If it's the same controller and the same action... Can you notice which pagination you need to use? If so, you can set the pagination options before each paginate function.

Link: http://book.cakephp.org/view/1231/Pagination#!/view/1232/Controller-Setup


I think you should use Ajax Pagination

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜