tags:

views:

48

answers:

1

So What I'm trying to do is create pagination, with a max of 5 pages showing. If there are only five pages that are returned from my MySQL statement, return the five pages. Otherwise, return 2 pages in each direction. So ideally, if I'm currently on page 1, it shows pages 1 2 3 4 5. If I am on page 5 and there are a max of 5 pages, show 1 2 3 4 5. If, however, I am on page 20, and there are 100 total, I would like to show 18 19 20 21 22. Any suggestions?

A: 

Take a look at Zend_Paginator

Yanick Rochon