0
votes

I have a question about the Zend_Paginator. By default pages goes like:

<Previous 1 2 3 4 5 6 7 8 ... Next>

Is this possible to have order like

<Previous 8 7 6 5 4 3 2 ... Next>

1
Extend Zend_Paginator class and override _createPages method - b.b3rn4rd

1 Answers

1
votes

No need to mess with the paginator class, you control how the pages are displayed with your paginator control script.

In your control script you will find a code like:

<!--Number page links-->
 <td>|
      <?php foreach ($this->pagesInRange as $page):?>
            <?php if ($page != $this->current) :?>
                  <a href="<?php echo $this->url(array_merge($params, array('page' => $page)))?>">
                  <?php echo $page?></a> |
            <?php else:?>
                  <?php echo $page?> |
       <?php
             endif;
             endforeach;
       ?>
 </td>

This is where you can reverse the order of the pages if you choose. Just use normal PHP array functions to get the page order you desire.