/** * Creates a new Events model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new Events(); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id' => $model->id]); } else { return $this->render('create', ['model' => $model]); } }
/** * Creates a new Events model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new Events(); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['index', 'EventsSearch[title]' => $model->title]); } else { return $this->renderAjax('_form', ['model' => $model]); } }