little Pagination/Uri offset problem - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: little Pagination/Uri offset problem (/showthread.php?tid=21777) |
little Pagination/Uri offset problem - El Forum - 08-20-2009 [eluser]AzizLight[/eluser] Hi everybody, I'm pretty new to CI, I mainly followed videos from BinaryCake and Nettus/Tuts+. I just finished the lastest nettuts plus tut on pagination in CI, everything works perfectly except that little uri problem. Basically what happens is that: -when I'm on page 1, the url is http://localhost:8888/mamp/CodeIgniter/pagination/index.php/blogs/index/ -on page 2 http://localhost:8888/mamp/CodeIgniter/pagination/index.php/blogs/index/1 -page 3 http://localhost:8888/mamp/CodeIgniter/pagination/index.php/blogs/index/2, etc where it should be (I think) http://localhost:8888/mamp/CodeIgniter/pagination/index.php/blogs/index/3 on page 3. Here is the code snippet in question: Code: function index() I tried to change $config['per_page'] to 2 and I got a similar problem: Code: $config['per_page'] = 2; Now there is clearly something wrong with my code... Can somebody explain me what's the problem please? little Pagination/Uri offset problem - El Forum - 08-20-2009 [eluser]GSV Sleeper Service[/eluser] There's nothing wrong with your code, the documentation is incorrect. the value in the URI is actually the offset, not the page number as it states. little Pagination/Uri offset problem - El Forum - 08-20-2009 [eluser]AzizLight[/eluser] Oh ok thanks. But in that case how would I be able to display the correct page number in the URI please? little Pagination/Uri offset problem - El Forum - 08-21-2009 [eluser]GSV Sleeper Service[/eluser] write your own pagination library! the CI one is quite easy to modify |