public function actionIndex2() { $searchModel = new AutoSearch(); $searchModel->city_url = $this->city_url; $searchModel->day = ArrayHelper::getValue(Yii::$app->request->queryParams, 'AutoSearch.day'); $dataProvider = $searchModel->search(Yii::$app->request->queryParams, $this->city); $this->title = "Бронирование авто в " . $this->city_padezh; return $this->render('index2', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]); }
/** * @param $id * @return string * @throws NotFoundHttpException */ public function actionOurCars($slug_url) { $accountModel = Account::findOne(['slug_url' => $slug_url]); if (empty($accountModel)) { $this->setNotFoundHttpException(); } $params['AutoSearch']['account_id'] = $accountModel->id; $this->title = "Автопрокат - " . $accountModel->username; $searchModel = new AutoSearch(); $searchModel->setScenario('salon-cars'); $dataProvider = $searchModel->search($params); return $this->render('ourCars', ['dataProvider' => $dataProvider, 'accountModel' => $accountModel]); }