/** * Lists all Page models. * @return mixed */ public function actionIndex() { // /echo 'index';die; $searchModel = new PageSearch(); //$dataProvider = $searchModel->searchNews(Yii::$app->request->queryParams); $dataProvider = $searchModel->searchNews(Yii::$app->request->queryParams); $lang = Lang::getCurrent(); switch ($lang->local) { case Lang::LANG_EN: $meta_key = 'news-list-en'; break; case Lang::LANG_RU: default: $meta_key = 'news-list-ru'; break; } $meta_info = MetaInfo::getMetaInfo($meta_key); return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider, 'meta_info' => $meta_info]); }
/** * Lists all Page models. * @return mixed */ public function actionIndex() { $searchModel = new PageSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]); }