Example #1
0
 /**
  * Lists all Page models.
  * @return mixed
  */
 public function actionIndex()
 {
     $searchModel = new PageSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     $dataProvider->query->andFilterWhere(['locale' => Yii::$app->language]);
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }
 /**
  * Lists all Page models.
  *
  * @return mixed
  */
 public function actionIndex()
 {
     $searchModel = new PageSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     $dataProvider->sort = ['defaultOrder' => ['created_at' => SORT_DESC]];
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }
Example #3
0
 /**
  * Lists all Page models.
  * @return mixed
  */
 public function actionIndex()
 {
     $searchModel = new PageSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     $dataProvider->query->andFilterWhere(['locale' => Yii::$app->language]);
     $models = Page::find()->andFilterWhere(['domain_id' => Yii::getAlias('@defaultDomainId'), 'locale' => 'uk-UA'])->all();
     $list = \yii\helpers\ArrayHelper::map($models, 'locale_group_id', 'title');
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider, 'list' => $list]);
 }
Example #4
0
 /**
  * Lists all Page models.
  * @return mixed
  * @throws \yii\base\InvalidParamException
  */
 public function actionIndex()
 {
     $searchModel = new PageSearch();
     $dataProvider = $searchModel->search(\Yii::$app->request->queryParams);
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }