使用管理员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
答案 0 :(得分:1)
试试这种方式
<li>
<?= Html::a('<span> Site </span><small class="label pull-right bg-red">3</small>',
['/site/index'],
['class'=>'fa fa- calendar'],
]) ?>
</li>