【问题标题】:Yii bootstrap, adding id and class to TbBootstrapYii bootstrap,给 TbBootstrap 添加 id 和 class
【发布时间】:2013-12-04 08:33:54
【问题描述】:

我正在使用 PHP Yii 框架,遇到了一个关于将 Id 和其他属性添加到选项卡的问题。顺便说一下,我正在使用 yii bootstrap 作为扩展:

$tabs = array(
        'item1' => array(
            'label' => 'label1',
            'content' => $content1,
        ),
        'preview' => array(
            'label' => 'Preview',
        ),
    );

$this->widget('bootstrap.widgets.TbWizard', 
     array(
        'id' => 'harvest-tabs',
        'type' => 'tabs',
        'tabs' => $tabs,
        'pagerContent' => false,
    ));

如何为每个选项卡“item1”和“预览”添加“id”和“类”属性? 我试过了:

'item1' => array(
                'label' => 'label1',
                'content' => $content1,
                'id' => 'some id'
                'class' => 'some class'
            ),
            'preview' => array(
                'label' => 'Preview',
                'id' => 'some other id'
                'class' => 'some other class'
            ),

但这并没有给它添加一个类。我只看到<li>'s 用作选项卡的容器。对不起,我是这里的新手。我会很感激任何帮助谢谢!

【问题讨论】:

    标签: php class twitter-bootstrap yii


    【解决方案1】:

    你应该试试这个:

    'item1' => array(
        'label' => 'label1',
        'content' => $content1,
        'htmlOptions'=>array(
            'id' => 'some id'
            'class' => 'some class'
        ),
    ),
    

    我没有尝试过,但我在这里遵循 yii 引导逻辑。如果它不起作用,请告诉我。

    【讨论】:

      猜你喜欢
      • 2013-08-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-08-22
      • 2012-10-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多