我正在尝试创建一个显示glyphicon的列 . glyphicon将链接到允许用户下载文件的URL . 任何帮助都将受到大力赞赏 . 目前的代码如下:
GridView::widget([
'dataProvider' => $dataProvider,
'pager' => [
'class' => 'common\widgets\Pagination',
],
'columns' => [
['class' => 'yii\grid\SerialColumn'],
[
'label' => 'Date',
'attribute' => 'call_datetime',
'format' => 'date',
],
[
'label' => 'Time',
'attribute' => 'call_datetime',
'format' => 'time',
],
'call_from',
'call_to',
'duration',
'call_type',
'extension',
[
'label' => 'File',
'attribute' => 'fname',
'value' => 'callRecFiles.fname',
],
这是用户将要下载的最后一个属性“fname” .
1 回答
将
fname
字段数组更改为:并准备适当的操作以允许用户下载文件 .