public function run() { $model = new LoginByEmail(); if ($model->load(Yii::$app->request->post()) && $model->login()) { return $this->render('widgetLogin', ['model' => $model]); } else { return $this->render('widgetLogin', ['model' => $model]); } }
public function actionLogin() { if (!\Yii::$app->user->isGuest) { return $this->goHome(); } // $userSettings = Yii::$app->cache->get('userSettings'); $model = new LoginByEmail(); if ($model->load(Yii::$app->request->post()) && $model->login()) { return $this->goBack(); } else { return $this->render('login', ['model' => $model]); } }