Exemplo n.º 1
0
 public function actionLogin()
 {
     if (!\Yii::$app->user->isGuest) {
         return $this->goHome();
     }
     $model = new LoginForm();
     if ($model->load(Yii::$app->request->post()) && $model->login()) {
         //Путь возврата настроен в web.php, returnUrl
         //$this->redirect(['/employee/view', 'id' => Yii::$app->user->getId()]);
         return $this->goBack();
     } else {
         return $this->render('login', ['model' => $model, 'users' => $model->getUserList()]);
     }
 }