Exemplo n.º 1
0
 public function deleteAction()
 {
     try {
         $page = $this->pageService->findPage($this->params('id'));
     } catch (\InvalidArgumentException $e) {
         return $this->redirect()->toRoute('admin');
     }
     $request = $this->getRequest();
     if ($request->isPost()) {
         $del = $request->getPost('delete_confirmation', 'no');
         if ($del === 'yes') {
             $this->pageService->deletePage($page);
         }
         return $this->redirect()->toRoute('admin');
     }
     return new ViewModel(array('page' => $page));
 }