Yii 1.1. CMenu like bootstrap navbar with submenu

You are viewing revision #1 of this wiki article.
This version may not be up to date with the latest version.
You may want to view the differences to the latest version.

next (#2) »

Expand the menu <?php $this->widget('zii.widgets.CMenu', array( 'items'=>array( // Important: you need to specify url as 'controller/action', // not just as 'controller' even if default action is used. array('label'=>'Home', 'url'=>array('site/index')), // 'Products' menu item will be selected no matter which tag parameter value is since it's not specified. array( 'label'=>'Products ', 'url'=>array('#'), 'linkOptions'=> array( 'class' => 'dropdown-toggle', 'data-toggle' => 'dropdown', ), 'items'=>array( array('label'=>'New Arrivals', 'url'=>array('product/new', 'tag'=>'new')), array('label'=>'Most Popular', 'url'=>array('product/index', 'tag'=>'popular')) ), 'itemOptions'=>array('class'=>'dropdown')), array('label'=>'Login', 'url'=>array('site/login'), 'visible'=>Yii::app()->user->isGuest), ) ,'htmlOptions'=>array('class'=>'nav navbar-nav') ,'submenuHtmlOptions'=>array('class'=>'dropdown-menu') ,'encodeLabel'=>false ,'activeCssClass' => 'active' ) ); ?>
0 0
1 follower
Viewed: 23 443 times
Version: Unknown (update)
Category: Tutorials
Written by: kv4nt
Last updated by: kv4nt
Created on: Feb 10, 2016
Last updated: 8 years ago
Update Article

Revisions

View all history

Related Articles