Example #1
0
 public function search($params)
 {
     $query = User::find();
     $dataProvider = new ActiveDataProvider(['query' => $query, 'sort' => ['defaultOrder' => ['id' => SORT_DESC]], 'pagination' => ['pageSize' => 20]]);
     // load the search form data and validate
     if (!($this->load($params) && $this->validate())) {
         return $dataProvider;
     }
     // adjust the query by adding the filters
     $query->filterWhere(['like', 'full_name', $this->full_name])->andFilterWhere(['like', 'email', $this->email]);
     return $dataProvider;
 }