X-Git-Url: http://git.inspyration.org/?p=zf2.biz%2Fgalerie.git;a=blobdiff_plain;f=module%2FGalerie%2Fsrc%2FGalerie%2FController%2FIndexController.php;h=b8847a0cbde5f5032355eebd8f6582091f289114;hp=8d33090aa2763ccc1c36589e75ae334d6b109fe2;hb=be46560bc8bd090930c4d0ede944a9b74ab59a15;hpb=477f62c0b8380aaa9fd2ab2e05dd2c85468aeeec diff --git a/module/Galerie/src/Galerie/Controller/IndexController.php b/module/Galerie/src/Galerie/Controller/IndexController.php index 8d33090..b8847a0 100644 --- a/module/Galerie/src/Galerie/Controller/IndexController.php +++ b/module/Galerie/src/Galerie/Controller/IndexController.php @@ -40,12 +40,34 @@ class IndexController extends AbstractActionController public function editAction() { - return array(); + // Récupération de l'objet de travail + $id = $this->params()->fromRoute('id', null); + $galerie = $this->_getGalerieTable()->any($id); + + // Récupération de l'objet requête + $request = $this->getRequest(); + if ($request->isPost()) { + // Validation des données + + if (true) {//TODO: Si les données sont valides + // Sauvegarde des données + // $this->_getGalerieTable()->save(?TODO?); + + // Redirection + return $this->redirect()->toRoute('galerie'); + } + } + return new ViewModel(array( + 'id' => $id, + 'galerie' => $galerie, + )); } public function delAction() { - return array(); + return $this->redirect()->toRoute('galerie/view', array( + 'id' => $id, + )); } public function viewAction()