public function feedMenuModule() { $list = []; $pages = Page::find()->andWhere('isActive = 1')->orderBy(['root' => SORT_DESC, 'lft' => SORT_ASC])->all(); foreach ($pages as $page) { $list[] = ['label' => $page->nestedTitle, 'route' => 'page/front/view', 'params' => ['id' => $page->id]]; } return $list; }
public function search($params) { $query = Page::find(); $dataProvider = new ActiveDataProvider(['query' => $query, 'sort' => ['defaultOrder' => ['root' => SORT_DESC, 'lft' => SORT_ASC]]]); $this->load($params); if (!$this->validate()) { $query->where('0=1'); return $dataProvider; } $query->andFilterWhere(['id' => $this->id, 'isActive' => $this->isActive]); $query->andFilterWhere(['like', 'title', $this->title]); $query->andFilterWhere(['like', 'language', $this->language]); return $dataProvider; }