Пример #1
0
 /**
  * Creates a new Notificaciones model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new CrearNotificacionForm();
     $model->scenario = CrearNotificacionForm::ESCENARIO_CREAR;
     if ($model->load(Yii::$app->request->post()) && ($notificacion = $model->crear())) {
         Yii::$app->session->setFlash('toasts', 'Se ha enviado la notificación');
         return $this->redirect(['index']);
         return $this->redirect(['view', 'id' => $notificacion->idnotificacion]);
     } else {
         return $this->render('create', ['model' => $model]);
     }
 }