0

I need to call my modal widget from a navbar using 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 doesnt work there, what can i do?

Sergio_HW
  • 155
  • 3
  • 18

2 Answers2

1

Use linkOptions instead of htmlOptions

...
array('label' => 'Filtro', 'linkOptions' => array('data-toggle' => 'modal','data-target' => '#myModal')),
...
topher
  • 14,790
  • 7
  • 54
  • 70
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'),
                )),
        )
    )
    )
;?>

There you have the answer :D

Sergio_HW
  • 155
  • 3
  • 18