public function actionIndex() { if (Yii::$app->user->isGuest) { $this->redirect('/user/sign-in/login', 200); } $searchModel = new PartnerSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); $model = new LoginForm(); if (Yii::$app->request->isAjax) { $model->load($_POST); Yii::$app->response->format = Response::FORMAT_JSON; return ActiveForm::validate($model); } if ($model->load(Yii::$app->request->post()) && $model->login()) { return $this->goBack(); } else { return $this->render('index', ['model' => $model]); } }
/** * Lists all Partner models. * @return mixed */ public function actionIndex() { $searchModel = new PartnerSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]); }