yii-multilevel-horizontal-menu This extension consists of a multilevel horizontal menu.

  1. Demo
  2. Usage

This extension consists of a responsive, multilevel, horizontal menu. In small devices, a combobox will appear instead of the menu.

The code has been taken from this website: http://www.dynamicdrive.com/style/csslibrary/item/jquery_multi_level_css_menu_2

Demo

Click here for the demo

Usage

First of all, you need to register the jQuery library.

Secondly, you have to add this little piece of code where you want a combobox menu to appear in small devices.

<span id="insertHere"></span>

Finally, you have to add this piece of code where you want your menu to appear:

<?php
$this->widget('ext.multilevelhorizontalmenu.MultilevelHorizontalMenu',
array(
"menu"=>array(
  array("url"=>"",
               "label"=>"Products",
          array("url"=>array(
                       "route"=>"/product/create"),
                       "label"=>"Create product",),
          array("url"=>array(
                      "route"=>"/product/list"),
                      "label"=>"Product List",),
          array("url"=>"",
                       "label"=>"View Products",
          array("url"=>array(
                       "route"=>"/product/show",
                       "params"=>array("id"=>3),
                       "htmlOptions"=>array("title"=>"title")),
                       "label"=>"Product 3"),
            array("url"=>"",
                         "label"=>"Product 4",
                array("url"=>array(
                             "route"=>"/site/index",
                             "params"=>array("lang"=>'en')),
                             "label"=>"Product 5")))),
          array("url"=>array(
                       "route"=>"/event/create"),
                       "label"=>"Sales"),
          array("url"=>array(
                       "route"=>"/event/create"),
                       "label"=>"Extensions",
                       "visible"=>false),
          array("url"=>array(),
                       "label"=>"Documentation",
              array("url"=>array(
                           "link"=>"http://www.yiiframework.com",
                           "htmlOptions"=>array("target"=>"_BLANK")),
                           "label"=>"Yii Framework"),
          array("url"=>array(
                       "route"=>"/product/clothes"),
                       "label"=>"Clothes",
          array("url"=>array(
                       "route"=>"/product/men",
                       "params"=>array("id"=>3),
                       "htmlOptions"=>array("title"=>"title")),
                       "label"=>"Men"),
            array("url"=>"",
                         "label"=>"Women",
                array("url"=>array(
                             "route"=>"/product/scarves",
                             "params"=>array("id"=>5)),
                             "label"=>"Scarves"))),
              array("url"=>array(
                           "route"=>"site/menuDoc"),
                           "label"=>"Disabled Link",
						   "disabled"=>true),
                )
          ),
)
);
?>

(The structure of this extension is based on the SMenu)

0 0
1 follower
390 downloads
Yii Version: 1.1.*
License: GPL-3.0
Category: User Interface
Developed by: oligalma
Created on: Mar 31, 2015
Last updated: a year ago

Downloads

show all

Related Extensions