/** * Creates a new Palestrante model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $this->autorizaUsuario(); $model = new Palestrante(); if ($model->load(Yii::$app->request->post())) { if ($model->save()) { $this->mensagens('success', 'Palestrante Cadastrado', 'Palestrante foi Cadastrado com Sucesso'); } else { $this->mensagens('danger', 'Palestrante Não Cadastrado', 'Houve um erro ao adicionar o Palestrante'); } return $this->redirect(['index']); } else { return $this->render('create', ['model' => $model]); } }