Twitter bootstrap YII:无法设置TbButton的ID?

Twitter bootstrap YII:无法设置TbButton的ID?,twitter-bootstrap,yii,Twitter Bootstrap,Yii,我有一个生成按钮的视图: $view->widget('bootstrap.widgets.TbButton', array( 'id' => 'removeButton', 'label' => $label, 'buttonType' => 'ajaxButton', ... etc 当按钮生成,我检查代码时,我看到: <button name="yt0" id="yt0" class="btn b

我有一个生成按钮的视图:

$view->widget('bootstrap.widgets.TbButton', array(
    'id'         =>   'removeButton',
    'label'      =>  $label,
    'buttonType' => 'ajaxButton', 
  ... etc
当按钮生成,我检查代码时,我看到:

<button name="yt0" id="yt0" class="btn btn-primary btn-large" data-loading-text="loading...."  type="button">Add to Cart</button>
为什么名称和id都是yt0而不是我指定的removeButton?

应该是:

$view->widget('bootstrap.widgets.TbButton', array(
  'htmlOptions'   => array('id'=> 'removeButton'),
   etc
应该是:

$view->widget('bootstrap.widgets.TbButton', array(
  'htmlOptions'   => array('id'=> 'removeButton'),
   etc
完整示例:

<?php
$this->widget('bootstrap.widgets.TbButton', array(
    'buttonType' => 'submit',
    'type' => $model->isNewRecord ? 'primary' : 'info',
    'label' => $model->isNewRecord ? 'Create' : 'Save',
    'loadingText' => 'Saving...',
    'htmlOptions'   => array('tabindex'=>7, 'id'=>'submit-button', 'class'=>'buttonStateful'),
));
?>


<script>
$('.buttonStateful').click(function() {
    var btn = $(this);
    btn.button('loading'); // call the loading function
    setTimeout(function() {
        btn.button('reset'); // call the reset function
    }, 3000);
});
<
完整示例:

<?php
$this->widget('bootstrap.widgets.TbButton', array(
    'buttonType' => 'submit',
    'type' => $model->isNewRecord ? 'primary' : 'info',
    'label' => $model->isNewRecord ? 'Create' : 'Save',
    'loadingText' => 'Saving...',
    'htmlOptions'   => array('tabindex'=>7, 'id'=>'submit-button', 'class'=>'buttonStateful'),
));
?>


<script>
$('.buttonStateful').click(function() {
    var btn = $(this);
    btn.button('loading'); // call the loading function
    setTimeout(function() {
        btn.button('reset'); // call the reset function
    }, 3000);
});
<