我需要给 GridView 的 td 添加类。我找到了 renderTagAttributes(),但是我找不到如何使用它的示例。
您能为我解释一下这个函数或者提供其他选项吗?
我的 GridView:
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
'id',
'name',
'price',
'quantity',
'created_at',
[
'class' => 'yii\grid\ActionColumn',
'template' => '{update} {delete}',
]
],
]); ?>
提前致谢