duanhe2027 2013-05-27 10:12
浏览 20
已采纳

使用Yii-Booster在TbButtonColumn上显示文本而不是图标

I'm using TbButtonColumn to render some icon buttons. I want to render text instead of the icons. Is this possible and how would I alter the following code to do this?

  1. $gridColumns = array(
  2. array('name'=>'nick_name', 'header'=>'Interests Sets'),
  3. array(
  4. 'htmlOptions' => array('nowrap'=>'nowrap'),
  5. 'class'=>'bootstrap.widgets.TbButtonColumn',
  6. 'template'=>'{add} {view}',
  7. 'buttons'=>array(
  8. 'add' => array
  9. (
  10. 'label'=>'See this friend\'s list',
  11. 'icon'=>'plus',
  12. 'url'=>'Yii::app()->createUrl("itemList/viewlist", array("friend_id"=>$data->id))',
  13. 'options'=>array(
  14. 'class'=>'btn btn-small',
  15. ),
  16. ),
  17. 'view' => array(
  18. 'label'=>'Search under this friend\'s interesrs',
  19. 'url'=>'Yii::app()->createUrl("friend/filter", array("friend_id"=>$data->id))',
  20. 'options'=>array(
  21. 'class'=>'btn btn-small',
  22. ),
  23. ),
  24. ),
  25. )
  26. );
  • 写回答

2条回答 默认 最新

  • donglu9445 2013-05-27 23:46
    关注

    I know nothing about yii-booster, but if it's anything like Yii's CButtonColumn, you only need to set the imageUrl to false. Like this:

    1. 'view' => array(
    2. 'imageUrl'=>false, // Setting an empty string does not work in vanilla Yii.
    3. 'label'=>'Search under this friend\'s interesrs',
    4. 'url'=>'Yii::app()->createUrl("friend/filter", array("friend_id"=>$data->id))',
    5. 'options'=>array(
    6. 'class'=>'btn btn-small',
    7. ),
    8. ),
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)
编辑
预览

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部