Render string in 'label' of Yii2 Bootstrap widget as HTML -


i'm using yii2's bootsrap tabs widget (yii\bootstrap\tabs -- http://www.yiiframework.com/doc-2.0/yii-bootstrap-tabs.html)

i want insert html tags value of label key in array builds widget.

i tried including key => value pair of 'encode' => true 1 of optional array elements did nothing.

here's code:

<?= tabs::widget([     'navtype' => 'nav-pills',     'options' => ['class' => 'course-manager'],     'items' => [         [             'label' => '<i class="fa fa-book"></i>&nbsp;show books',             'encode' => true,             'content' => '<h2>anim pariatur cliche...</h2>',             'active' => true         ],         [             'label' => '<i class="fa fa-graduation-cap"></i><span>&nbsp;show students</span>',             'encode' => true,             'content' => 'anim cliche...',         ],         [             'label' => '<i class="fa fa-tags"></i><span>&nbsp;show licenses</span>',             'encode' => true,             'url' => 'http://www.example.com',         ],     ], ]); ?> 

those labels being displayed text instead of html.

if want html code rendered should use 'encodelabels' => false,

tabs::widget([   'navtype' => 'nav-pills',   'options' => ['class' => 'course-manager'],   'encodelabels' => false,   'items' => [     [         'label' => '<i class="fa fa-book"></i>&nbsp;show books',         'content' => '<h2>anim pariatur cliche...</h2>',         'active' => true     ], 

Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -