rssController.php 920 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. class rssController extends ActionController {
  3. public function firstAction() {
  4. header('Content-Type: text/xml');
  5. header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');
  6. header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
  7. header('Pragma: public');
  8. $this->view->_useLayout (false);
  9. }
  10. public function publicAction () {
  11. $entryDAO = new EntryDAO ();
  12. $entryDAO->_nbItemsPerPage (-1);
  13. $items = $entryDAO->listPublic ('low_to_high');
  14. try {
  15. $page = Request::param('page', 1);
  16. $nb = Request::param('nb', 15);
  17. $this->view->itemPaginator = new Paginator($items);
  18. $this->view->itemPaginator->_nbItemsPerPage($nb);
  19. $this->view->itemPaginator->_currentPage($page);
  20. } catch(CurrentPagePaginationException $e) {
  21. Error::error(
  22. 404,
  23. array('error' => array('La page que vous cherchez n\'existe pas'))
  24. );
  25. }
  26. }
  27. public function getNbNotReadAction() {
  28. }
  29. }