dongniuxia8650 2018-03-11 07:36
浏览 56
已采纳

将代码添加到图标Yii中

I have font icons and it work with class name and code, like this:

<i class="meh-icon icon-kids">&#xe87a;</i>

this is my code:

$items[1][] = array(
   'label' => $cat->name,
   'icon' => "meh-icon icon-" . $cat->icon . " icon-cat",
   'url' => aUrl('/discover/', array('section' => 'category', 'action' => $cat->url))
);

but it shows:

<i class="meh-icon icon-kids"></i>

I want add code into icon.

please help me. thank you.

  • 写回答

1条回答 默认 最新

  • dtl85148 2018-04-03 07:00
    关注

    Just add 'encodeLabel' => false to your items array

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?