0

我需要使用 Yiibooster 从导航栏中调用我的模态小部件

<?php $this->widget(
    'bootstrap.widgets.TbNavbar',
    array(
        'brand' => 'Inicio',
        'fixed' => false,
        'items' => array(
            array(
                'class' => 'bootstrap.widgets.TbMenu',
                'items' => array(
                    array('label' => 'Home', 'url' => '#', 'active' => true),
                    array('label' => 'Filtro', 'htmlOptions' => array('data-toggle' => 'modal','data-target' => '#myModal'),
                    array('label' => 'Nuevo', 'url' => Yii::app()->baseUrl.'/ZfInmuebles/create'),
                )
            )
        )
    )
));?>

htmlOptions 在那里不起作用,我该怎么办?

4

2 回答 2

1

使用linkOptions代替htmlOptions

...
array('label' => 'Filtro', 'linkOptions' => array('data-toggle' => 'modal','data-target' => '#myModal')),
...
于 2014-02-08T08:25:59.427 回答
0
<?php $this->widget(
    'bootstrap.widgets.TbNavbar',
    array(
        'brand' => 'Zona Franca',
        'fixed' => false,
        'collapse' => true,
        'items' => array(
            array(
                'class' => 'bootstrap.widgets.TbMenu',
                'items' => array(
                    array('label' => 'Inicio', 'url' => Yii::app()->baseUrl),
                    array('label' => 'Nuevo', 'url' => Yii::app()->baseUrl.'/ZfArrendatarios/create'),
                )),
            array(
                'class' => 'bootstrap.widgets.TbMenu',
                'htmlOptions' => array('data-toggle' => 'modal','data-target' => '#myModal'),
                'items' => array(
                    array('label' => 'Filtro', 'url' => '#myModal'),
                )),
        )
    )
    )
;?>

你有答案:D

于 2014-02-08T14:58:14.130 回答