pagination in module action

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
User avatar
rotezecke
Power Poster
Power Poster
Posts: 411
Joined: Fri Apr 18, 2008 9:34 pm
Location: Nimbin, Australia

pagination in module action

Post by rotezecke »

Can someone point me in a direction of a current module that implements pagination for frontend, or more specifically: I'm trying to integrate pagination with the Holidays module and its HolidaysQuery class. Thanks.
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3479
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: pagination in module action

Post by velden »

News module? action.default.php for example
User avatar
rotezecke
Power Poster
Power Poster
Posts: 411
Joined: Fri Apr 18, 2008 9:34 pm
Location: Nimbin, Australia

Re: pagination in module action

Post by rotezecke »

the holiday module uses

Code: Select all

  $query = new HolidayQuery(array('published'=>1,'limit'=>$limit));
  $holidays = $query->GetMatches();
News (or cgblog) seem to do all the sql stuff inside the action.default file. can pagination be achieved with the above class? assuming that such a query class is best practice? i could just scrap the Holiday approach and clone the News approach, but that would be leaving the path of the tutorial before i even completed it. but I'm not clever enough to combine the two approaches.
Post Reply

Return to “Developers Discussion”