diff options
| author | 2012-10-29 18:31:05 +0100 | |
|---|---|---|
| committer | 2012-10-29 18:31:05 +0100 | |
| commit | 9d801981de02d270410e589e0bb906abed95fc6f (patch) | |
| tree | 265cf3617d24b9bdbf92d55eeb45d75803c36d63 /app/controllers/indexController.php | |
| parent | 6c24d394916e26a91a95224a1d4cd8f22960695d (diff) | |
Fix bug #2
Diffstat (limited to 'app/controllers/indexController.php')
| -rwxr-xr-x | app/controllers/indexController.php | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/app/controllers/indexController.php b/app/controllers/indexController.php index a4e81ab90..315e301ad 100755 --- a/app/controllers/indexController.php +++ b/app/controllers/indexController.php @@ -40,10 +40,17 @@ class indexController extends ActionController { } // Gestion pagination - $page = Request::param ('page', 1); - $this->view->entryPaginator = new Paginator ($entries); - $this->view->entryPaginator->_nbItemsPerPage ($this->view->conf->postsPerPage ()); - $this->view->entryPaginator->_currentPage ($page); + try { + $page = Request::param ('page', 1); + $this->view->entryPaginator = new Paginator ($entries); + $this->view->entryPaginator->_nbItemsPerPage ($this->view->conf->postsPerPage ()); + $this->view->entryPaginator->_currentPage ($page); + } catch (CurrentPagePaginationException $e) { + Error::error ( + 404, + array ('error' => array ('La page que vous cherchez n\'existe pas')) + ); + } $this->view->cat_aside = $catDAO->listCategories (); $this->view->nb_favorites = $entryDAO->countFavorites (); |
