Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] Paging Numbers
#4

[eluser]SneakyDave[/eluser]
You don't need to configure num_links unless you want to, it's optional, and only shows how many page links BESIDE the current page to display. It seems I ALWAYS have to configure the uri_segment, as CI doesn't set it for me, like it should.

http://ellislab.com/codeigniter/user-gui...ation.html

I fought for a while with the pagination class thinking the links it generated were wrong, but realized that the links it generates are for the number of results to skip per page, not the page number, so your links for pages 1,2,3,4 would look like this if you have assigned 20 results per page...
http://yoursite.com/page/
http://yoursite.com/page/40
http://yoursite.com/page/60
http://yoursite.com/page/80

And the pagination class would only generate the necessary number of page links based on the total_rows.

One thing I haven't been able to figure out is how to use the pagination in a config file named pagination.php.

I can create the /config/pagination.php file with the $config array setting the options I want, but how do I set the total_rows from the result? I can't do it in the pagination.php file because I don't know the number of rows at that point in time. So can I set some of the pagination options in the config file, and the total_rows in my controller?


Messages In This Thread
[SOLVED] Paging Numbers - by El Forum - 10-20-2009, 08:11 PM
[SOLVED] Paging Numbers - by El Forum - 10-21-2009, 02:32 AM
[SOLVED] Paging Numbers - by El Forum - 10-21-2009, 10:37 AM
[SOLVED] Paging Numbers - by El Forum - 10-21-2009, 01:19 PM
[SOLVED] Paging Numbers - by El Forum - 10-21-2009, 10:18 PM



Theme © iAndrew 2016 - Forum software by © MyBB