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