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