Exemple #1
0
 /**
  * Logs in a user.
  *
  * @return mixed
  */
 public function actionLogin()
 {
     $this->layout = 'unify/registration';
     if (!\Yii::$app->user->isGuest) {
         return $this->goHome();
     }
     $model = new LoginForm();
     if ($model->load(Yii::$app->request->post()) && $model->login()) {
         $cart = new HybrizyCartForm();
         $cart->dumpSessionToDb(true);
         return $this->goBack();
     } else {
         return $this->render('login', ['model' => $model]);
     }
 }