php - Yii Framework - Twiiter Bootstrap TbMenu in Navbar options -


i'm beginning work on yii , php , using twitter bootstrap cniska.net , able make work.

however i'm finding difficulties in making work way want to. , have not found useful in docs, although might have missed something.

i have navbar this:

      $this->widget('bootstrap.widgets.tbnavbar', array(           'brand'=>'xpto',           'brandurl'=>'#',           'fixed' => 'top',           'collapse'=>true, // requires bootstrap-responsive.css           'items'=>array(               array(                   'class'=>'bootstrap.widgets.tbmenu',                   'items'=>array(                       array('label'=>'1st link', 'url'=>'#', 'active'=>true),                       array('label'=>'2nd link', 'url'=>'#'),                       array('label'=>'3rd link', 'url'=>'#'),                       array('label'=>'4thlink', 'url'=>'#'),                   ),               ), (..) 

so, first of 2 questions:

underneath 'brand'=>'xpto', possible enter path image? example logo? know can try enter image path how images alongside each other? (this avoid me creating , image containing 2).

secondly:

i want manipulate , add page movement in layout according link click, therefore, *i add 'id' attribute each 'li', so final result like:

<li class="active" id="xyz"><a href="#"> link text </a></li>

i have tried

array('label'=>'2nd link', 'url'=>'#', 'id'=>'xyz'),

and

array('label'=>'2nd link', 'url'=>'#', 'htmloptions'=>array( 'id'=>'xyz'),),

but no success.

any tips? in advance.

to image work embed image in brand name so:

'brand'=>'<img src="path_to_img.jpg"/>" 

as second question, spend 20 minutes scouring source , found out called 'itemoptions' not 'htmloptions' when item has htmloptions. add id use:

array('label'=>'first link', 'url'=>"#", 'itemoptions'=>array('id' => 'xyz')) 

Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -