Yii 1.1: verticalmenu2levels

This extension consists of a 2-levels vertical menu.
4 followers

This extension consists of a 2-levels vertical menu. It is based on the "SMenu" extension. The css code has been taken from http://cssmenumaker.com. If you are interested in more than 2 levels, you should try this menu.

Try out a demo

Click here for the demo

Requirements

Yii 1.1 or above

Usage

<?php
$this->widget('ext.verticalmenu2levels.VerticalMenu2Levels',
array(
"menu"=>array(
        array("url"=>array("route"=>"site/index",
                          'params'=>array('lang'=>'en')),
                          "label"=>'Home'),
        array("url"=>array(
                               "route"=>"/event/create"),
                               "label"=>"Create",
                               "visible"=>false),
          array("url"=>array(),
                       "label"=>'Products',
                      array("url"=>array(
                                   "link"=>"http://google.com",
                                  'htmlOptions'=>array('target'=>'_BLANK')),                               
                                   "label"=>"Google"),
                      array("url"=>array(
                                   "route"=>"site/product2",
                                  'params'=>array('lang'=>'en')),                                                                                                                      
                                   "label"=>"Product 2"),
                      array("url"=>array(
                                   "route"=>"site/product3",
                                  'params'=>array('lang'=>'en')),                                                                                                                      
                                   "label"=>"Product 3",
                                   "disabled"=>true
                                  ),                                                                                   
                        ),                                                                                                    
          array("url"=>array(),
                       "label"=>'About',
                      array("url"=>array(
                                   "route"=>"site/company",),                              
                                   "label"=>"Company"),
                      array("url"=>array(
                                   "route"=>"site/contact",),                                                                                                                      
                                   "label"=>"Contact"),                                    
                        ),
        array("url"=>array("route"=>"site/contact",
                          'params'=>array('lang'=>'en')),
                          "label"=>'Contact'),                                    
          ),
)
);
?>

Total 4 comments

#19152 report it
oligalma at 2015/03/30 01:29am
RE: option visible

yes, it is possible to hide an item!

Just use the 'visible' property like this:

array("url"=>array(
                       "route"=>"/event/create"),
                       "label"=>"Create",
                       "visible"=>false),
#19145 report it
Gledson Eduardo at 2015/03/29 09:31pm
option visible

Hi,

Greate job!

It's possible hidde item based in param like if($_SESSION['level'] == 1 array("url" => array(),........ ?

thanks

Update: Thanks, works fine!

#18625 report it
kaif at 2014/12/03 02:14am
Awesom extension

Thanks to Moginn and the team for such an simple installation and excellent extension. Highly recommended....

#18529 report it
kebyang1511 at 2014/11/11 11:53am
It WORKS!

Thanks man!.... Simple and effective..

I just downloaded the extension and extract...

copy paste the sample code... it worked...

all I need to do is to tweak the code... ! awesom!

Leave a comment

Please to leave your comment.

Create extension