Yii2 - GridView - 如何将表数据包含在html标签中?

时间:2015-06-30 17:06:17

标签: gridview yii2 yii2-advanced-app

我是yii2的新手。我试图将GridView的表数据括在锚标记中。

<?= GridView::widget([
// is there any property that can be set to achieve this?
    'dataProvider' => $dataProvider,
    'filterModel' => $searchModel,
    'columns' => [
        ['class'=>'yii\grid\SerialColumn'],
        ['attribute' => 'customer_user_name2',],
    ],
]); ?>

数据应该在html页面中呈现,如下所示

<td> <!-- how to add this? --> <a>data</a> </td>

感谢。

1 个答案:

答案 0 :(得分:0)

我相信他会帮助你: http://www.bsourcecode.com/yiiframework2/gridview-in-yiiframework-2-0/#gridview-table-options 如何在Gridview中添加table和tableRow。