|
General Details
|
|
PHP (Hypertext Preprocess...
|
|
Posted 1.45 Year Ago
|
|
955 Views
|
|
Received 3 Ratings
|
|
Pagination Class
Description
Takes care of the hard work when creating pagination and can carry across variables between pages in the pages URL. Multiple instances of pagination can be used on a single page.
Technical
Does not pass across POST vars so they will be lost but it's not usually required to pass post vars around with pagination (bad coding practice). Improvements could be to add a template system to it and allow for mod-rewrite URL's. Max and Min page are automatically set.
Source Code
Comments
| Please login to post comments. |
|
|
Why would you want to initiate it before you know the values? I decided not to do it that way because in 99% of the cases there would be no need to. If you are not forced to supply those values upon construction then it results in less error checking in other methods and prevents the user from forgetting to set properties.
Kind regards,
Scott
|
|
|
My two cents...
Nice! Simple and elegant. However, in my opinion there is two much overhead in the Ctor. What if, I want to instantiate the class before knowing what my values are. Why not create a mutator method for the instance, total per page and total items. So that these can be set at a later time during execution.
Just a thought.
|
|
|
Thanks a lot Scott, I'm stealing this one and putting it into my latest junk. Keep the goodies coming.
|
|
|
Nice, just what I was looking for. Ported it straight into one of my classes!
|
More "PHP (Hypertext Preprocessor)" Source Codes By This Author
Recently Posted "PHP (Hypertext Preprocessor)" Source Codes
Recently Rated "PHP (Hypertext Preprocessor)" Source Codes
|