Beispiel #1
0
 /**
  * Creates a new pagina
  */
 public function createAction()
 {
     if (!$this->request->isPost()) {
         return $this->dispatcher->forward(array("controller" => "pagina", "action" => "index"));
     }
     $pagina = new Pagina();
     $pagina->setPaginaNombrecontrolador($this->request->getPost("pagina_nombreControlador"));
     $pagina->setPaginaNombreaccion($this->request->getPost("pagina_nombreAccion"));
     if (!$pagina->save()) {
         foreach ($pagina->getMessages() as $message) {
             $this->flash->error($message);
         }
         return $this->dispatcher->forward(array("controller" => "pagina", "action" => "new"));
     }
     $this->flash->success("pagina was created successfully");
     return $this->dispatcher->forward(array("controller" => "pagina", "action" => "index"));
 }