The title is a bit wonky but it’s the best I could come up with at 4 in the morn’. I have a table of links that I am paginating, nothing fancy. Let’s say there are 100 links that are displayed 20 a page for 5 pages. How can I number each link starting with 1 and ending with 20 on the first page and if we skipped to the last page would be 81 through 100. I have multiple queries changing the direction and ORDER BY of my queries so this would have to be dynamically. Done using CakePHP 1.2. An example of this would be reddit.com
Share
Try this in the view:
This’ll give you a bit of inside information about the current status of the paginator. For example, you’ll find this:
'limit'being the “items per page” and'page'being, well, the page.With this information it should be pretty trivial to insert this kind of counter into your output.