Generic paging class
Posted: Sun Sep 25, 2005 10:20 pm
I HATE writing code for pagination of records and having to keep track of the page index, number of items to display, etc...so I have considered trying to invent some generic paging class to assist in the madness...
I have looked at all the PHP Paging classes out there (from what could be easily found via Google anyways) and none really appeal to me. There either tied to a specific database like MySQL or require to much tinkering and tweaking to get working.
So my question then is:
Has anyone ever used a PHP Paging class which just dropped into their code and was ready to go? Can I have the link so as to steal ideas from a existing solid class or use it directly if it's good enough.
What I have considered thus far is a class which uses a callback to fill an array from whatever data source desired.
- RDBMS
- Flat file
- XML
- LDAP, etc...
Of course this creates problems onto it's own, cuz now you need a callback to get the total number of records, etc...
Anyways, just an idea I figured I'd blow by you guys and see what I could back as far as feedback
Cheers
I have looked at all the PHP Paging classes out there (from what could be easily found via Google anyways) and none really appeal to me. There either tied to a specific database like MySQL or require to much tinkering and tweaking to get working.
So my question then is:
Has anyone ever used a PHP Paging class which just dropped into their code and was ready to go? Can I have the link so as to steal ideas from a existing solid class or use it directly if it's good enough.
What I have considered thus far is a class which uses a callback to fill an array from whatever data source desired.
- RDBMS
- Flat file
- XML
- LDAP, etc...
Of course this creates problems onto it's own, cuz now you need a callback to get the total number of records, etc...
Anyways, just an idea I figured I'd blow by you guys and see what I could back as far as feedback
Cheers