/** * Creates a new Test model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new Test(); $model->createDate = date("Y-m-d H:i:s"); $model->userCreate = Yii::$app->user->id; $model->userUpdate = Yii::$app->user->id; if ($model->loadWithFiles(Yii::$app->request->post()) && $model->save()) { Yii::$app->session->setFlash('success', 'Well done! successfully to save data! '); return $this->redirect(['index']); } else { return $this->render('create', ['model' => $model]); } }