public function search($params) { $query = Karma::find(); $dataProvider = new ActiveDataProvider(['query' => $query]); // load the search form data and validate if (!($this->load($params) && $this->validate())) { return $dataProvider; } // adjust the query by adding the filters $query->andFilterWhere(['id' => $this->id]); $query->andFilterWhere(['points' => $this->points]); $query->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'description', $this->description]); return $dataProvider; }
/** * Configuration Action for Super Admins */ public function actionIndex() { $searchModel = new KarmaSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('index', array('dataProvider' => $dataProvider, 'searchModel' => $searchModel, 'model' => Karma::find())); }