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