/** * Creates a new tipos_vehiculo */ public function createAction() { if (!$this->request->isPost()) { return $this->dispatcher->forward(array("controller" => "tipos_vehiculo", "action" => "index")); } $tipos_vehiculo = new TiposVehiculo(); $tipos_vehiculo->tipo = $this->request->getPost("tipo"); $tipos_vehiculo->tarifa = $this->request->getPost("tarifa"); if (!$tipos_vehiculo->save()) { foreach ($tipos_vehiculo->getMessages() as $message) { $this->flash->error($message); } return $this->dispatcher->forward(array("controller" => "tipos_vehiculo", "action" => "new")); } $this->flash->success("tipos_vehiculo was created successfully"); return $this->dispatcher->forward(array("controller" => "tipos_vehiculo", "action" => "index")); }