public function search($params) { $query = ContentFlag::find(); $dataProvider = new ActiveDataProvider(['query' => $query]); if (!($this->load($params) && $this->validate())) { return $dataProvider; } $query->andFilterWhere(['value' => $this->value, 'sort_num' => $this->sort_num]); $query->andFilterWhere(['like', 'id', $this->id])->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'description', $this->description]); return $dataProvider; }
public function actionIndex() { $query = ContentFlag::find(); $locals = LuLu::getPagedRows($query, ['order' => 'value asc']); return $this->render('index', $locals); }