Welcome Guest, Not a member yet? Register   Sign In
pagination not reading config file
#19

[eluser]Gyzm[/eluser]
Is this local or live? Wondering if I can view the output.

It should be noted that there are two different issues within this thread.

1 - Boony wants the "First" and "Last" links to appear. Boony, the first and last links will appear on their own when the page result range is beyond 2 pages from the currently viewed page. If you want them to appear sooner you can change it to 1. If you set to 0 you'll get the error "Your number of links must be set to a positive number". Not much you can do about that other than modify Pagination.php to work the way you want it. That being said, if you think about it, there is really no need to have first and last appear unless they are beyond a reasonable range.

2 - The anchor class issue: During my testing I discovered that if you loaded the configs through their own config file ("./application/config/pagination.php") then the anchor class would be set properly. If you take this route the configs are passed through the Pagination class' constructor. With CI 2.0.2's current Pagination class commit the anchor class check is located within the constructor so this is all well and good but if you are to pass the configs via $this->pagination->initialize($config) then the anchor class doesn't get set because the check/set control structure is in the constructor. Using $this->pagination->initialize() happens after the constructor as been called. That's why I suggested moving the anchor class check/set to the initialize method, which makes sense anyway because it's a variable that needs to be initialized. The constructor calls the initialize method so, whether you use a pagination.php config file or $this->pagination->initialize() the anchor_class check/set will always occur.

Bigmike, at this point I can only assume that $config['first_tag_open'] and $config['first_tag_close'] are working for you. The reason why you're not seeing them is the same reason Boony isn't: your results haven't gone beyond the num_links range. Default is 2 +1. It's line 197 in Pagination.php:

// Render the "First" link
Code:
if ($this->first_link !== FALSE AND $this->cur_page > ($this->num_links + 1))

I have made a pull request to commit this change but nothing has happened yet. This bug still exists.

Does this help?


Messages In This Thread
pagination not reading config file - by El Forum - 05-05-2011, 06:06 PM
pagination not reading config file - by El Forum - 05-05-2011, 07:28 PM
pagination not reading config file - by El Forum - 05-05-2011, 08:16 PM
pagination not reading config file - by El Forum - 05-05-2011, 08:36 PM
pagination not reading config file - by El Forum - 05-05-2011, 09:04 PM
pagination not reading config file - by El Forum - 05-05-2011, 09:37 PM
pagination not reading config file - by El Forum - 05-05-2011, 10:11 PM
pagination not reading config file - by El Forum - 05-05-2011, 11:31 PM
pagination not reading config file - by El Forum - 05-05-2011, 11:56 PM
pagination not reading config file - by El Forum - 05-06-2011, 12:09 AM
pagination not reading config file - by El Forum - 05-06-2011, 01:19 AM
pagination not reading config file - by El Forum - 05-25-2011, 08:35 PM
pagination not reading config file - by El Forum - 05-30-2011, 09:23 PM
pagination not reading config file - by El Forum - 06-30-2011, 06:53 PM
pagination not reading config file - by El Forum - 06-30-2011, 10:41 PM
pagination not reading config file - by El Forum - 06-30-2011, 10:50 PM
pagination not reading config file - by El Forum - 06-30-2011, 11:10 PM
pagination not reading config file - by El Forum - 06-30-2011, 11:19 PM
pagination not reading config file - by El Forum - 07-01-2011, 12:10 AM



Theme © iAndrew 2016 - Forum software by © MyBB