RSSPaginator.php 686 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. // Un système de pagination beaucoup plus simple que Paginator
  3. // mais mieux adapté à nos besoins
  4. class RSSPaginator {
  5. private $items = array ();
  6. private $next = '';
  7. public function __construct ($items, $next) {
  8. $this->items = $items;
  9. $this->next = $next;
  10. }
  11. public function isEmpty () {
  12. return empty ($this->items);
  13. }
  14. public function items () {
  15. return $this->items;
  16. }
  17. public function next () {
  18. return $this->next;
  19. }
  20. public function peek () {
  21. return empty($this->items) ? null : $this->items[0];
  22. }
  23. public function render ($view, $getteur) {
  24. $view = APP_PATH . '/views/helpers/'.$view;
  25. if (file_exists ($view)) {
  26. include ($view);
  27. }
  28. }
  29. }