pagination.phtml 1.5 KB

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. $c = Request::controllerName ();
  3. $a = Request::actionName ();
  4. $params = Request::params ();
  5. ?>
  6. <?php if ($this->nbPage > 1) { ?>
  7. <ul class="pagination">
  8. <?php if ($this->currentPage > 1) { ?>
  9. <?php $params[$getteur] = 1; ?>
  10. <li class="pager-first"><a href="<?php echo Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>">« Début</a></li>
  11. <?php $params[$getteur] = $this->currentPage - 1; ?>
  12. <li class="pager-previous"><a href="<?php echo Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>">‹ Précédent</a></li>
  13. <?php } ?>
  14. <?php for ($i = $this->currentPage - 2; $i <= $this->currentPage + 2; $i++) { ?>
  15. <?php if($i > 0 && $i <= $this->nbPage) { ?>
  16. <?php if ($i != $this->currentPage) { ?>
  17. <?php $params[$getteur] = $i; ?>
  18. <li class="pager-item"><a href="<?php echo Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>"><?php echo $i; ?></a></li>
  19. <?php } else { ?>
  20. <li class="pager-current"><?php echo $i; ?></li>
  21. <?php } ?>
  22. <?php } ?>
  23. <?php } ?>
  24. <?php if ($this->currentPage < $this->nbPage) { ?>
  25. <?php $params[$getteur] = $this->currentPage + 1; ?>
  26. <li class="pager-next"><a href="<?php echo Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>">Suivant ›</a></li>
  27. <?php $params[$getteur] = $this->nbPage; ?>
  28. <li class="pager-last"><a href="<?php echo Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>">Fin »</a></li>
  29. <?php } ?>
  30. </ul>
  31. <?php } ?>