예제 #1
0
 /**
  * Creates a new acceso
  */
 public function createAction()
 {
     if (!$this->request->isPost()) {
         return $this->dispatcher->forward(array("controller" => "acceso", "action" => "index"));
     }
     $acceso = new Acceso();
     $acceso->setRolId($this->request->getPost("rol_id"));
     $acceso->setPaginaId($this->request->getPost("pagina_id"));
     if (!$acceso->save()) {
         foreach ($acceso->getMessages() as $message) {
             $this->flash->error($message);
         }
         return $this->dispatcher->forward(array("controller" => "acceso", "action" => "new"));
     }
     $this->flash->success("acceso was created successfully");
     return $this->dispatcher->forward(array("controller" => "acceso", "action" => "index"));
 }