/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Partners::find(); $dataProvider = new ActiveDataProvider(['query' => $query]); $this->load($params); if (!$this->validate()) { // uncomment the following line if you do not want to return any records when validation fails // $query->where('0=1'); return $dataProvider; } $query->andFilterWhere(['id' => $this->id, 'created_date' => $this->created_date, 'updated_date' => $this->updated_date, 'active' => $this->active]); $query->andFilterWhere(['like', 'image', $this->image])->andFilterWhere(['like', 'title_en', $this->title_en])->andFilterWhere(['like', 'title_ru', $this->title_ru])->andFilterWhere(['like', 'title_am', $this->title_am])->andFilterWhere(['like', 'description_en', $this->description_en])->andFilterWhere(['like', 'description_ru', $this->description_ru])->andFilterWhere(['like', 'description_am', $this->description_am])->andFilterWhere(['like', 'projects_en', $this->projects_en])->andFilterWhere(['like', 'projects_ru', $this->projects_ru])->andFilterWhere(['like', 'projects_am', $this->projects_am]); return $dataProvider; }
public function actionPartners() { $partners = Partners::find()->all(); return $this->render('partners', ['partners' => $partners]); }