![]() |
Pagination problem [SOLVED] - 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: Pagination problem [SOLVED] (/showthread.php?tid=29517) |
Pagination problem [SOLVED] - El Forum - 04-12-2010 [eluser]Ngulo[/eluser] hi,i've a problem paginating data from db here is my Controller templates.php: Code: <?php the pagination is working ,and i see perfectly pagination links... but when i click on pagination links the page take me back an error: Code: 404 Page Not Found the links are good beacuse they takes me to the base url i have set for $offset : Code: www.asd.com/index.php/admin/templates/offset(1...or...2...or ....3...) why? :O Pagination problem [SOLVED] - El Forum - 04-12-2010 [eluser]karloff[/eluser] maybe using routes would be the answer? Code: $route['admin/templates/:num'] = "admin/templates"; probably not the best answer but I thought I'd throw it out there? Pagination problem [SOLVED] - El Forum - 04-12-2010 [eluser]erik.brannstrom[/eluser] The problem is that the controller will try to find a method with the name 1 (or 2 or 3..) since the method name always comes after the controller name in the URI. You probably need to specify your index method to be used in your base url, i.e. $config['base_url'] = site_url('admin/templates/index/'). Try it, I think that should do it.. Pagination problem [SOLVED] - El Forum - 04-12-2010 [eluser]Ngulo[/eluser] yep,sorry guys ![]() erik is right.....i fix the problem, before : using $config[‘base_url’] = site_url(‘admin/templates/index/’) and after i've just put the $config uri-segment to (4) instead of (3) (default) ,now the segment is catch!!! thanks a lot for supporting ![]() Pagination problem [SOLVED] - El Forum - 07-11-2012 [eluser]tulasi[/eluser] Hi, i have a problem. i used $config[‘base_url’] = site_url(‘admin/templates/index/’) and uri-segment to (4) pagination is working for me but i always see '1' as highlited (i.e nolink for it) and previous link(<<) not found. Can someone please help? Pagination problem [SOLVED] - El Forum - 07-11-2012 [eluser]Aken[/eluser] Need to post your code. Pagination problem [SOLVED] - El Forum - 07-11-2012 [eluser]tulasi[/eluser] Code: class Logstats extends CI_Controller { Pagination problem [SOLVED] - El Forum - 07-11-2012 [eluser]Aken[/eluser] You need to set the uri_segment config option for the pagination to know which page it's on. Pagination problem [SOLVED] - El Forum - 07-11-2012 [eluser]tulasi[/eluser] Thanks for your fast reply. Its working.... |