Example #1
0
 /**
  * Creates a new Tipo model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new Tipo();
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         return $this->redirect(['view', 'id' => $model->id]);
     } else {
         return $this->render('create', ['model' => $model]);
     }
 }
Example #2
0
 /**
  * Creates a new Tipo model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $this->autorizaUsuario();
     $model = new Tipo();
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         $this->mensagens('success', 'Tipo Criado', 'O tipo \'' . $model->titulo . '\' foi criado com sucesso');
         return $this->redirect(['index']);
     } else {
         return $this->render('create', ['model' => $model]);
     }
 }