Yii Framework Forum: Colocar Componente Em Um Widget - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Colocar Componente Em Um Widget inserir botões em um TbNavbar Rate Topic: -----

#1 User is offline   begnini 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 13
  • Joined: 13-September 12
  • Location:cascavel

Posted 09 November 2012 - 01:53 PM

Eu estou usando o 'bootstrap.widgets.TbNavbar' e gostaria de por dois botões ali.

Código do widget na minha view:
<?php
$this->widget('bootstrap.widgets.TbNavbar', array(
    'type' => 'inverse', // null or 'inverse'
    'brand' => '',
    'brandUrl' => '/comilones/administracao',
    'collapse' => true, // requires bootstrap-responsive.css
    'fixed' => 'top',
    'items' => array(
        array(
            'class' => 'bootstrap.widgets.TbMenu',
            'items' => array(
                array('label' => 'teste', 'url' => array('/teste')),
                array('label' => 'admin', 'url' => array('/teste/admin')),
            ),
        ),
        array(
            'class' => 'bootstrap.widgets.TbMenu',
            'htmlOptions' => array('class' => 'pull-right'),
            'items' => array(
                '---',
                array('label' => date('d/m/Y'), 'url' => '#'),
                '---',
                array('label' => 'Minha Conta', 'url' => '#', 'items' => array(
                        array('label' => 'Empresa', 'url' => '/projeto/empresa/update/' . Yii::app()->user->id),
                        array('label' => 'Logout (' . Yii::app()->user->name . ')', 'url' => array('/site/logout')),
                )),
            ),
        ),
    ),
        )
);
?>


Eu quero adicionar isso ali dentro:
<div class="btn-group" data-toggle="buttons-radio">
    <button class="btn active">On</button>
    <button class="btn">Off</button>    
</div>


Eu criar uma view e coloquei isso nela, para dar um renderPartial pra ela na lista de itens, mas ele fica fora da navbar.
Eu também criei um widget com esses botões, mas chamando o widget na lista de intes ele também fica fora da navbar.

Como eu faço pra por esses dois botões dentro da TbNavbar?

valeu
0

#2 User is offline   Lothor 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 147
  • Joined: 05-August 11
  • Location:Brazil

Posted 05 February 2013 - 06:29 AM

begnini, já tentou assim?

<?php
$this->widget('bootstrap.widgets.TbNavbar', array(
        'type' => 'inverse', // null or 'inverse'
        'brand' => '',
        'brandUrl' => '/comilones/administracao',
        'collapse' => true, // requires bootstrap-responsive.css
        'fixed' => 'top',
        'items' => array(
            array(
                'class' => 'bootstrap.widgets.TbMenu',
                'items' => array(
                    array('label' => 'teste', 'url' => array('/teste')),
                    array('label' => 'admin', 'url' => array('/teste/admin')),
                ),
            ),
            array(
                'class' => 'bootstrap.widgets.TbMenu',
                'htmlOptions' => array('class' => 'pull-right'),
                'items' => array(
                    '---',
                    array('label' => date('d/m/Y'), 'url' => '#'),
                    '---',
                    array('label' => 'Minha Conta', 'url' => '#', 'items' => array(
                            array('label' => 'Empresa', 'url' => '/projeto/empresa/update/' . Yii::app()->user->id),
                            array('label' => 'Logout (' . Yii::app()->user->name . ')', 'url' => array('/site/logout')),
                    )),
                ),
            ),
            '<div class="btn-group" data-toggle="buttons-radio">
                <button class="btn active">On</button>
                <button class="btn">Off</button>    
             </div>',
        ),
    )
);
?>

0

#3 User is offline   Newerton 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 803
  • Joined: 27-April 10
  • Location:Campo Grande/MS - Cambé/PR, Brasil

Posted 05 February 2013 - 06:59 AM

Begnini,

Veja se isso resolve.

http://www.yiiframew...-de-um-gridview
Newerton Vargas de Araújo
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users