Exemplo n.º 1
0
 public function actionLogin()
 {
     $model = new LoginForm();
     if ($model->load(Yii::$app->request->post())) {
         if ($model->login()) {
             $this->redirect(['admin/default/index']);
         }
     }
     return $this->render('login', ['model' => $model]);
 }
Exemplo n.º 2
0
 public function actionLogin()
 {
     if (!Yii::$app->user->isGuest) {
         return $this->goHome();
     }
     $model = new LoginForm();
     if ($model->load(Yii::$app->request->post()) && $model->login()) {
         return $this->goBack();
     }
     return $this->render('login', ['model' => $model]);
 }
 public function actionLogin()
 {
     if (!Yii::$app->getUser()->getIsGuest()) {
         return $this->goHome();
     }
     $this->layout = false;
     $model = new LoginForm();
     if ($model->load(Yii::$app->getRequest()->post()) && $model->login()) {
         return $this->goHome();
     } else {
         return $this->render('login', ['model' => $model]);
     }
 }