コード例 #1
0
 /**
  * Creates a new tipoEquipo
  */
 public function createAction()
 {
     if (!$this->request->isPost()) {
         return $this->dispatcher->forward(array("controller" => "tipoequipo", "action" => "index"));
     }
     $tipoEquipo = new Tipoequipo();
     $tipoEquipo->setTipoequipoNombre($this->request->getPost("tipoEquipo_nombre"));
     $tipoEquipo->setTipoequipoHabilitado(1);
     if (!$tipoEquipo->save()) {
         foreach ($tipoEquipo->getMessages() as $message) {
             $this->flash->error($message);
         }
         return $this->dispatcher->forward(array("controller" => "tipoequipo", "action" => "new"));
     }
     $this->flash->success("El tipo de equipo ha sido creado correctamente");
     return $this->dispatcher->forward(array("controller" => "tipoequipo", "action" => "index"));
 }