Generic Pagination Class |
[eluser]theprodigy[/eluser]
I've written a generic paginate class. It can be used as a CI custom Library or in non-CI applications (as it does not contain any CI specific functionality) 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 ( it through my php ocd into overdrive, lol ). My class asks for the number of pages you want shown, not the number of links before/after. My class allows you to set things via a generic config function (with an assoc array as a parameter), or individual setter methods (each method has it's own set of parameters, see documented code for specifics). The things you can set are: Code: $first_link_text; All items have default values, so you can choose to only set a few or all. Also, this pagination class takes page numbers not record offset numbers. What is returned is an array: Code: array( 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. |
Messages In This Thread |
Generic Pagination Class - by El Forum - 04-12-2010, 07:19 PM
Generic Pagination Class - by El Forum - 04-14-2010, 06:15 AM
Generic Pagination Class - by El Forum - 04-27-2010, 03:57 PM
|