Exemple #1
0
 public function actionLogin()
 {
     if (!\Yii::$app->user->isGuest) {
         return $this->goHome();
     }
     $model = new AdminLoginForm();
     if ($model->load(Yii::$app->request->post()) && $model->login()) {
         return $this->goBack();
     } else {
         return $this->render('login', ['model' => $model]);
     }
 }
Exemple #2
0
 public function actionIndex()
 {
     //$session = new Session;
     //$session->open();
     if (!\Yii::$app->user->isGuest) {
         //return $this->goHome();
         return $this->render('dashboard');
     }
     $model = new AdminLoginForm();
     if ($model->load(Yii::$app->request->post()) && $model->login()) {
         //Yii::$app->session->set('aaa','abir');
         return $this->render('dashboard');
     } else {
         return $this->render('login', ['model' => $model]);
     }
 }