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