Finally got my shit together with Object-Oriented PHP- let’s just say – it rules. OOP with PHP is riduclously easy- and powerful.
Just pass a 2D array and makes a paginated display. Also comes with an example script.
The best thing about classes is the code re-use. I had this exact same funtionality built out as functions- and it was never as portable as it is as a class.
Using classes in PHP is also cake. Include the class, instantiate it:
$pager = new Pager();
You can easily override a class with extends, or opt to customize the class to accept more user-servicable methods. The choice is yours.