Answer the question
In order to leave comments, you need to log in
Why is search not working in gridVew Yii2?
There is a GridView which is in between :
<?php $f = ActiveForm::begin
....
endForm?>
public function search($id = null,$floraTaxonId = null,$params)
{
$query = Taxon::find();
// add conditions that should always apply here
$dataProvider = new ActiveDataProvider([
'query' => $query,
]);
$this->load($params);
// grid filtering conditions
$query->andFilterWhere([
'id' => $this->id,
'rang_id' => $this->rang_id,
]);
$query->andFilterWhere(['like', 'name', $this->name])
->andFilterWhere(['like', 'hybrid', $this->hybrid])
->andFilterWhere(['like', 'literature', $this->literature])
->andFilterWhere(['like', 'habitat', $this->habitat]);
return $dataProvider;
}
Yii::$app->request->queryParams
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question