How do I set a default configuration for GridView in Yii2 without the widget factory?
问题 This is what a gridview looks like in Yii2: <?php echo GridView::widget([ 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [ ['class' => 'yii\grid\SerialColumn'], ... ['class' => 'yii\grid\ActionColumn'], ], ]); ?> I want change my grids a little bit, so I add this line: tableOptions'=>['class'=>'table table-condensed'], This works great, but... I want this to be the default value for all my grids! In Yii 1, this would look like this: 'widgetFactory' => array(