Galerie/Index Message d'erreur personnalisé
authorSébastien CHAZALLET <s.chazallet@gmail.com>
Wed, 7 Nov 2012 16:10:11 +0000 (17:10 +0100)
committerSébastien CHAZALLET <s.chazallet@gmail.com>
Wed, 7 Nov 2012 16:10:11 +0000 (17:10 +0100)
module/Galerie/src/Galerie/Controller/IndexController.php

index 66892fa..8d33090 100644 (file)
@@ -50,15 +50,12 @@ class IndexController extends AbstractActionController
 
     public function viewAction() 
     {
-        $galerie = $this->_getGalerieInfoTable()->any(
-            $this->params()->fromRoute('id', null)
-        );
-        if (!$galerie) {
-            $this->getResponse()->setStatusCode(404);
-            return;
-        }
+        $id = $this->params()->fromRoute('id', null);
+        $galerie = $this->_getGalerieInfoTable()->any($id);
         return new ViewModel(array(
+            'id' => $id,
             'galerie' => $galerie,
         ));
     } 
+
 }