Answer the question
In order to leave comments, you need to log in
Yii2, why doesn't search model work?
With the help of GII, CRUD was created. The search model, controller, and views have been created. In the controller, in actionIndex (read) the following code:
$searchModel = new ProductSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
]);
Answer the question
In order to leave comments, you need to log in
How should it work.
Can you please provide more model code and search model code.
Most likely, you have incorrectly described search conditions in your search model, or you are trying to use non-existent fields.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question