public function updatePageAction() { $page = $this->navigationManager->getPage($this->params('page')); $this->assertGranted('navigation.manage', $page); $this->pageForm->bind($page); if ($this->getRequest()->isPost()) { $data = $this->params()->fromPost(); $this->pageForm->setData($data); if ($this->pageForm->isValid()) { $this->navigationManager->updatePage($this->pageForm); $this->navigationManager->flush(); $this->flashMessenger()->addSuccessMessage('The page was successfully updated'); return $this->redirect()->toReferer(); } } else { $this->referer()->store(); } $view = new ViewModel(['form' => $this->pageForm]); $view->setTemplate('navigation/page/update'); return $view; }