How can I display all columns in gridview without define the columns that I want to displau in view ?
In Yii2 doc,
<?= GridView::widget([
'dataProvider' => $dataProvider,
'columns' => [ //define columns here
'id',
'name',
'created_at:datetime',
// ...
],
]) ?>
Can we just
<?= GridView::widget([
'dataProvider' => $dataProvider,
'columns' => '*',
]) ?>
SerialColumnorActionColumne.t.c too so just * wont help also the method that initializes these columnsinitColumns()is declared asprotectedso you cant override it too to add your own implementation for it. so just either dont specify columns option and let theguessColumn()do the work