projects
/
zf2.biz
/
galerie.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Contrôleur Galerie/View, 404 si galerie existe pas
[zf2.biz/galerie.git]
/
module
/
Galerie
/
src
/
Galerie
/
Controller
/
IndexController.php
diff --git
a/module/Galerie/src/Galerie/Controller/IndexController.php
b/module/Galerie/src/Galerie/Controller/IndexController.php
index
3fd3a47
..
66892fa
100644
(file)
--- a/
module/Galerie/src/Galerie/Controller/IndexController.php
+++ b/
module/Galerie/src/Galerie/Controller/IndexController.php
@@
-49,11
+49,16
@@
class IndexController extends AbstractActionController
}
public function viewAction()
}
public function viewAction()
- {
+ {
+ $galerie = $this->_getGalerieInfoTable()->any(
+ $this->params()->fromRoute('id', null)
+ );
+ if (!$galerie) {
+ $this->getResponse()->setStatusCode(404);
+ return;
+ }
return new ViewModel(array(
return new ViewModel(array(
- 'galerie' => $this->_getGalerieInfoTable()->one(
- $this->params()->fromRoute('id', null)
- ),
- ));
+ 'galerie' => $galerie,
+ ));
}
}
}
}