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