/** * Login application action. * @return string */ public function actionLogin() { $model = new LoginForm(); if ($model->load(Yii::$app->request->post()) && $model->login()) { return $this->goHome(); } return $this->render('login', ['model' => $model]); }