public function actionRegister() { $model = new RegisterForm(); $model->load(Yii::$app->request->post()); if ($model->validate()) { $model->registerUser(); return $this->render('index'); } return $this->render('register', ['model' => $model]); }