1

我正在使用管理员 LTE,并希望将侧边栏自定义为我的布局的一部分

Am customizing a link in yii2 by adding an extra style.
I have tried:
<li>
<?= Html::a('<span> Site </span>',['/site/index'],['class'=>'fa fa- calendar'],
  ['options'=>['template'=>'<small class="label pull-right bg-red">3</small>',
        ]]) ?>

    </li>

最终结果应该是:

<li>
      <a href="pages/calendar.html">
            <i class="fa fa-calendar"></i> <span>Calendar</span>
            <small class="label pull-right bg-red">3</small>
          </a>
 </li>

问题在于:

small class="label pull-right bg-red">3</small>
does not get displayed
4

1 回答 1

1

试试这个方法

<li>
 <?= Html::a('<span> Site </span><small class="label pull-right bg-red">3</small>',
    ['/site/index'],
    ['class'=>'fa fa- calendar'],
 ]) ?>
</li>
于 2015-09-05T14:21:55.127 回答