is pagination automatic? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: is pagination automatic? (/showthread.php?tid=20848) |
is pagination automatic? - El Forum - 07-23-2009 [eluser]johnnyForums[/eluser] If I have this code in my controller (index): Code: $data['title'] = 'My New Title'; Is that all I need or do I need a page that actually does database work to get paging to work? I ask because this brings back all the data each time instead of just five rows. I have 30k that come back each time. is pagination automatic? - El Forum - 07-23-2009 [eluser]elvix[/eluser] you need to pass a limit and offset to your get_products function. Limit is your per_page value and offset is will be in uri segment 4, based on your pagination setup above. hope that helps. is pagination automatic? - El Forum - 07-24-2009 [eluser]philm[/eluser] Snippet from one of mine if it helps make it a little clearer... ;-) Code: $data['pagination'] = $this->pagination->create_links(); |