Yii Bootstrap小部件的HTML标签TbButton

时间:2014-06-03 06:46:21

标签: php css3 twitter-bootstrap yii label

我在网页中使用了Yii Bootstrap小部件。这是我的代码:

<?php
    $this->widget('bootstrap.widgets.TbButton', array(
        'buttonType'=>'submit',
        'type'=>'primary',
        'label'=>'S U B M I <br>T',
        'htmlOptions'=>array(
            'name'=>'step2',
            'id'=>'winery-selected',
            'class'=>'btn btn-primary btn-responsive'
         )
    )); 
?>

<br/>

我想在br元素中添加label标记。如果我只是在br内添加label标记,则会显示如下图所示。

enter image description here

如何实现这一目标?

1 个答案:

答案 0 :(得分:2)

尝试添加此行'encodeLabel'=>false,

以下是您的代码,

<?php $this->widget('bootstrap.widgets.TbButton', array(
                            'buttonType'=>'submit',
                            'encodeLabel'=>false,
                            'type'=>'primary',
                            'label'=>'S U B M I <br>T',
                            'htmlOptions'=>array('name'=>'step2','id'=>'winery-selected','class'=>'btn btn-primary btn-responsive')
                        )); ?>