andyron
'value' => function($model){ return '<div><audio controls=""><source src="'.WEBURL.$model->audio.'" type="audio/mp3"></audio></div>'; }
这里的
value
换成content
试试。看了下
DataColumn
的实现,如果设置value而非Column
的content属性时,DataColumn会默认调用$this->grid->formatter->format
对内容进行格式化。至于为啥过滤掉你的audio标签,可能是你的写法不符合w3c标准?参考w2c School提供的案例:http://www.w3school.com.cn/html5/html5_audio.asp
@naivefang 那为什么此处只针对
audio
标签进行过滤?@lilongsy 应该不是这个问题,这种
$model->audio
是可以取得到的'value' => function($model){ return '<div><audio controls=""><source src="'.WEBURL.$model->audio.'" type="audio/mp3"></audio></div>'; }
这里的
value
换成content
试试。看了下
DataColumn
的实现,如果设置value而非Column
的content属性时,DataColumn会默认调用$this->grid->formatter->format
对内容进行格式化。至于为啥过滤掉你的audio标签,可能是你的写法不符合w3c标准?参考w2c School提供的案例:http://www.w3school.com.cn/html5/html5_audio.asp
换成
content
可以了,能解释一下value
和content
的区别吗?- andyron 赞了回答
'value' => function($model){ return '<div><audio controls=""><source src="'.WEBURL.$model->audio.'" type="audio/mp3"></audio></div>'; }
这里的
value
换成content
试试。看了下
DataColumn
的实现,如果设置value而非Column
的content属性时,DataColumn会默认调用$this->grid->formatter->format
对内容进行格式化。至于为啥过滤掉你的audio标签,可能是你的写法不符合w3c标准?参考w2c School提供的案例:http://www.w3school.com.cn/html5/html5_audio.asp
- andyron 2015-06-24 已签到连续签到7天,获得了20个金钱
- andyron 回复了话题 composer 干嘛这么神经?
开始,我也这么认为,但现在我认为这样很方便了,妈妈再也不用担心我的包管理,包依赖了,再也不用担心拷贝丢了谁了,包更新的问题了
- andyron 2015-06-23 已签到连续签到6天,获得了20个金钱
- andyron 2015-06-22 已签到连续签到5天,获得了20个金钱
- andyron 2015-06-21 已签到连续签到4天,获得了20个金钱