NYCPHP Meetup

NYPHP.org

[nycphp-talk] cakePHP pagination - multiple models with custom paginate() functions

Kristina Anderson ka at kacomputerconsulting.com
Wed Dec 1 10:55:12 EST 2010


Hi there everyone,

If anyone is familiar with CakePHP 1.2's usage of multiple models
(defined in the $pagination array) and using the call to $paginator in
the views, please contact me.  

I needed (or think I needed) to use multiple models because I need to
return more than 1 instance of paginate() and paginateCount() and all
three of these applets load each time one is posted...due to the way the
page I inherited is structured.

Since I implemented this, the separate resultsets from the call to the
custom (inherited and debugged) paginate() function are being returned
properly and display in the ajax response properly when parameters are
changed (each list has three selectboxes that feed in conditions for the
search results).  However all the results for each applet display at
once, instead of in sets of five as they did before in the single
applet, and a call to $paginate-> in the view causes an error.  

I will be happy to post the solution for all to see for future list
reference.  I am very willing to pay actual American cash money for any
assistance. 

I'm sure there is a very elegant way to fix this and would love to play
around with it for a week or so but my client is going ape$%#t and needs
this fixed ASAP.  Thanks in advance.

Kristina




More information about the talk mailing list