/** * Creates a new UserType model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new UserType(); if ($model->load(Yii::$app->request->post())) { $model->created_dt = date('Y-m-d H:i:s'); $model->save(); return $this->redirect(['index']); } else { return $this->render('create', ['model' => $model]); } }