Example #1
0
 /**
  * Lists all Block models.
  * @return mixed
  */
 public function actionIndex()
 {
     $searchModel = new BlockSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     $dataProvider->query->andFilterWhere(['locale' => Yii::$app->language]);
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }
Example #2
0
 /**
  * Lists all Block models.
  * @return mixed
  */
 public function actionIndex()
 {
     $searchModel = new BlockSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     $dataProvider->query->andFilterWhere(['locale' => Yii::$app->language]);
     $models = Block::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]);
 }