Welcome Guest, Not a member yet? Register   Sign In
Article or other text pagination helper
#2

[eluser]theprodigy[/eluser]
I've actually written my own paginate class.

It functions very similarly to CI's paginate class with one main difference.

I didn't like the fact with CI's pagination class that if you had 10 pages and set the number of links to 2 (2 before and 2 after), but were on page 1, it only showed 3 links, and if you were on page 2, it would show 4 links, and from then on out to page 8, it would show the 5 links you requested. Then it would go back to 4 links on page 9, and 3 links on page 10.

My class asks for the number of pages you want shown, not the number of links before/after. My class also allows you to set things via a generic config function, or individual setter methods.

What is returned is an array:
Code:
array(
     first => entire anchor tag for the first link
     last  => entire anchor tag for the last link
     prev  => entire anchor tag for the previous link
     next  => entire anchor tag for the next link
     pages => string containing multiple anchor tags for the individual pages, and the current page non-link.
     )

The code, I believe, is very well documented. I tried having a couple people alpha test it, but I have yet to hear any response.

You can download it here: Paginate Class

Please let me know what you think of this class, whether good or bad. I would love to hear your input.

P.S. This is basic pagination, not article pagination like Jelmer's listed above.


Messages In This Thread
Article or other text pagination helper - by El Forum - 07-30-2008, 09:59 AM
Article or other text pagination helper - by El Forum - 04-12-2010, 06:56 PM
Article or other text pagination helper - by El Forum - 04-12-2010, 07:00 PM
Article or other text pagination helper - by El Forum - 04-12-2010, 07:05 PM
Article or other text pagination helper - by El Forum - 04-12-2010, 07:20 PM



Theme © iAndrew 2016 - Forum software by © MyBB