yii 在GridView中怎样添加html代码

通过加上 'format' => 'html' 可以是 GridView 中的列具备html标签;

例子:

[
    'attribute' => 'remark',
    'value' => function ($model) {
        return Html::a('超链接', 'https://getcharzp.cn');
    },
    'format' => 'html',
]

 

posted @ 2020-03-06 13:43  GetcharZp  阅读(217)  评论(0)    收藏  举报