答案 0 :(得分:0)
是的可能
简单地说,Yii2中的选项卡表单基于bootstrap3 css tempalete,因此可以使用label(非编码)来分配img而不是标签文本
echo Tabs::widget([
'items' => [
[
'label' => '<img src="your_source_url/your_image.jpg">',
'encode' =>false,
'active' => true
],
或者对于bakground颜色,您可以使用指定您喜欢的样式(或类)的选项
echo Tabs::widget([
'items' => [
[
'label' => 'my_label',
'options' => ['style' ='background-color: red;]
'active' => true
],
http://www.yiiframework.com/doc-2.0/yii-bootstrap-tabs.html# $项细节