Jump to content
Larry Ullman's Book Forums

Adding An Argument To Bootstrap Form


giles
 Share

Recommended Posts

Hi,

 

I'm working through chapter 13, adding yii-booster nav bar to my Yii development. I hope its appropriate to ask this question here (apologies in advance if it is not). I have a simplified version below. I basically want to add a visibility argument to the search form. It's wrong, but i've included it to try illustrate what I'm after. Am I unable to add and if inside and array?

'items'=>array(
    
    // L/H menu
    array(
        'class'=>'bootstrap.widgets.TbMenu',
        'items'=>array(
            // GUESTS
            array('label'=>'Log In', 'url'=>array('/site/login'), 'visible'=>Yii::app()->user->isGuest),
            // USERS
            array('label'=>'Subject', 'url'=>'#', 'visible'=>!Yii::app()->user->isGuest, 'items'=>array(
                array('label'=>'YOUR BROWSING TODAY'),
                array('label'=>'My Body - Fitness - Programs', 'url'=>'#'),
                array('label'=>'My Body - Fitness - Motivation', 'url'=>'#'),
            )),
            // end (always visible)
            array('label'=>'Contact', 'url'=>array('/site/contact')),
        ),
    ),
    
    // search field
    if(!Yii::app()->user->isGuest) echo ''<form class="navbar-search pull-left" action=""><input type="text" class="search-query span2" placeholder="Search" ></form>''; ,

),
Link to comment
Share on other sites

 Share

×
×
  • Create New...