pagination.phtml 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. /**
  3. * @version 7.4
  4. */
  5. if ($this->pageCount) { ?>
  6. <div class="text-center">
  7. <ul class="pagination">
  8. <!-- Previous page link -->
  9. <?php if ($this->previous) { ?>
  10. <li>
  11. <a href="<?php echo $this->url(array('page' => $this->previous), null, true); ?>">
  12. &lt; <?php echo $this->_('Previous'); ?>
  13. </a>
  14. </li>
  15. <?php } ?>
  16. <?php if (min($this->pagesInRange) > 1) { ?>
  17. <li>
  18. <a href="<?php echo $this->url(array('page' => 1), null, true); ?>">1</a>
  19. </li>
  20. <?php } ?>
  21. <?php if (min($this->pagesInRange) > 2) { ?>
  22. <li class="disabled">
  23. <a href="#">...</a>
  24. </li>
  25. <?php } ?>
  26. <!-- Numbered page links -->
  27. <?php foreach ($this->pagesInRange as $page) { ?>
  28. <li <?php echo ($page == $this->current) ? 'class="active"' : ''; ?>>
  29. <a href="<?php echo $this->url(array('page' => $page), null, true); ?>"><?php echo $page; ?></a>
  30. </li>
  31. <?php } ?>
  32. <?php if (max($this->pagesInRange) < ($this->last - 1)) { ?>
  33. <li class="disabled">
  34. <a href="#">...</a>
  35. </li>
  36. <?php } ?>
  37. <?php if (max($this->pagesInRange) < $this->last) { ?>
  38. <li>
  39. <a href="<?php echo $this->url(array('page' => $this->last), null, true); ?>"><?php echo $this->last; ?></a>
  40. </li>
  41. <?php } ?>
  42. <!-- Next page link -->
  43. <?php if ($this->next) { ?>
  44. <li>
  45. <a href="<?php echo $this->url(array('page' => $this->next), null, true); ?>"><?php echo $this->_('Next'); ?>
  46. &gt;</a>
  47. </li>
  48. <?php } ?>
  49. </ul>
  50. </div>
  51. <?php } ?>