/** * Creates a new TipoDocumento model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new TipoDocumento(); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id' => $model->id]); } else { return $this->render('create', ['model' => $model]); } }
public function store() { try { $tipo = new TipoDocumento(); $tipo->tipo = Request::input('tipo'); $tipo->abrev = Request::input('abrev'); $tipo->save(); return $tipo; } catch (Exception $e) { return $e; } }