/** * Lists all Job models. * @return mixed */ public function actionIndex() { $searchModel = new JobSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); $dataProvider->pagination->pageSize = 20; return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]); }
/** * Lists all Job models. * @return mixed */ public function actionIndex() { if (\Yii::$app->user->isGuest) { return $this->render('guest'); } else { //Creates a new instance of JobSearch Model $searchModel = new JobSearch(); //calls the 'search' method in the search model, which loads the cities //which the user has access to and further filters them based on the query //Params $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]); } }
public function actionJob($id) { $jobSearch = new JobSearch(); $jobData = $jobSearch->searchByCompany(Yii::$app->request->queryParams); $jobData->pagination->pageSize = 20; return $this->render('job', ['model' => $this->findModel($id), 'jobData' => $jobData, 'jobSearch' => $jobSearch]); }