Q: Yii 2 GridView - set options for filter input field(s) As I've read the documents and tried everything, there's no way to add an input-sm HTML/Bootstrap class to the filter input fields of the GridView widget in Yii 2.
One thing I can do is to use jQuery, search for those elements and add them an input-sm class.
Is there a way to achive this in Yii 2?

A: It is possible, there is filterInputOptions for that in DataColumn class.
<?= GridView::widget([
    // ...
    'columns' => [
        // ...
        [
            'attribute' => 'name',
            'filterInputOptions' => [
                'class' => 'form-control input-sm', 
                'id' => null
            ],
        ]
    ],
]) ?>

