/** * Creates a new EstadosEmocionais model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new EstadosEmocionais(); if ($model->load(Yii::$app->request->post())) { $model->data = date('Y-m-d'); $model->criado_por = Yii::$app->user->getId(); if ($model->save()) { return $this->redirect(['view', 'id' => $model->id_estado_emocional]); } } else { return $this->render('create', ['model' => $model]); } }