Friends, there is such a widget created in the course of the video tutorial. Maybe I missed something, but for the second day I cannot find the cause of the error, which is that the added filter does not want to be displayed as index.php generated by CRUD. Those. input is not displayed.
<?= GridView::widget([ 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [ ['class' => 'yii\grid\SerialColumn'], 'id', [ 'attribute' => 'category_id', 'filter' => Category::find()->select(['name', 'id'])->indexBy('id')->column(), 'value' => function(Product $product){ return $product->category->name; }, ], [ 'attribute'=>'name', 'filter' => Product::find()->select(['name','id'])->indexBy('id')->column(), 'value' => function(Product $product){ return $product->name; } ], 'content:ntext', 'price', [ 'attribute' => 'Tags', 'filter' => Tag::find()->select(['name', 'id'])->indexBy('id')->column(), 'value' => function(Product $product) { return implode(', ', ArrayHelper::map($product->tags, 'id', 'name')); }, ], [ 'attribute' => 'active', 'format' => 'boolean', 'filter' => [0 => 'Нет', 1=> 'Да'], ], ['class' => 'yii\grid\ActionColumn'], ], ]); ?>