Answer the question
In order to leave comments, you need to log in
An example or how to implement filtering in Yii2?
Hello! There is a task, you need to implement a filter with a search on the page (Yii2).
As I plan to:
Create an Item, ItemSearch, ItemController model, add a form with a search field and a list of items (red, blue, etc.) to the index. But what to do next? How to pass the selected filters to the search model?
$dataProvider and $searchModel are in actionIndex.
Answer the question
In order to leave comments, you need to log in
You haven't provided enough data. Therefore, let's say you have a table (Item) with data and there is a color field.
Open gii and generate an Item model for it, then generate a CRUD for that model, specifying what will be search. As a data display, for starters, let it even be GRID.
Thus, you will get all the insides for work, and you will only have to work with the view, arrange it the way you drew in the picture.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question