Welcome Guest, Not a member yet? Register   Sign In
Beginners quetion - how to implement pagination
#2

[eluser]jedd[/eluser]
Hi jay.cz, and welcome to the CI forums.

There's a few ways you could approach this problem. Check the CI User Manual for any upper-case references I'm about to make.

You could look at ROUTES - these would let you re-write the URL on the way in. I think this might not be the best approach here, but I'm not a big proponent of routing as the answer to all problems.

You could look at having a sub-gallery by default even on galleries that don't have a sub-gallery. A reserved word that you set aside for this, and your controller would handle it as a special case. This would mean your pagination number will then consistently be at the same segment() number.

You could examine the first parameter in your controller's constructor, and if it is numeric you know you're dealing with a pagination offset for the default or primary gallery - if the first character is alpha then you know you're dealing with a sub-gallery. This is a variation on the route approach above, and is arguably messier (though it's probably the way I'd deal with the problem).

Finally, you could re-visit the approach of sub-galleries - unless you're relying on external data? Sub-galleries assume a single level of categorisation, which doesn't always work out.


Messages In This Thread
Beginners quetion - how to implement pagination - by El Forum - 06-27-2009, 07:33 AM
Beginners quetion - how to implement pagination - by El Forum - 06-27-2009, 08:54 AM
Beginners quetion - how to implement pagination - by El Forum - 06-27-2009, 10:08 AM



Theme © iAndrew 2016 - Forum software by © MyBB