Welcome Guest, Not a member yet? Register   Sign In
create_links() leaves Pagination object in inconsistent state
#4

[eluser]falloutphil[/eluser]
Sure - this may work. I accept that given no reset function 2 paginations is not explicitly supported - although if this is what Ellislab want they should prevent a second call to initalize() using a static counter.

To quote your example I think the problem will also occur if the user calls create_links more than once for the same pagination:

Code:
// view
echo $this->pagination->create_links('links1');
echo $this->pagination->create_links('links2');

The first create_links will alter the internal representation of cur_page, which will then break the second set of links. I believe this is within the realms of normal use.

The "reset" I've written simply makes use of the fact that the correct cur_page is stored earlier in the function before it is manipulated.

Phil.


Messages In This Thread
create_links() leaves Pagination object in inconsistent state - by El Forum - 03-04-2008, 05:24 AM



Theme © iAndrew 2016 - Forum software by © MyBB