This class can be use to generate navigation of listings split in multiple pages.
It takes as parameters the total number of items in the listing, the limit number of items to display per page and the number of the current page.
The class returns an array with the number of the first item and the range of items to show in the current page, the total number of pages, the need to present the next and previous links, and the LIMIT clause if the listing is to be retrieved from a MySQL database or similar.
The class also provides an iterator to return the navigation page offsets or HTML links to display in the current page. The template of the links is configurable. |