Giter Site home page Giter Site logo

cybercog / yii2-multilevel-horizontal-menu Goto Github PK

View Code? Open in Web Editor NEW

This project forked from host33/yii2-multilevel-horizontal-menu

0.0 3.0 0.0 66 KB

Yii2 extension that consists of a multilevel horizontal menu.

License: Other

PHP 40.23% JavaScript 39.37% CSS 20.40%

yii2-multilevel-horizontal-menu's Introduction

yii2-multilevel-horizontal-menu

This extension consists of a multilevel horizontal menu. It is based on the SMenu extension. The CSS code has been taken from this page: http://tympanus.net/codrops/2013/04/19/responsive-multi-level-menu/

Demo

http://www.ho33.com/en/yiimultilevelhorizontalmenu

Installation

The preferred way to install this extension is through composer.

Either run

$ php composer.phar require host33/yii2-multilevel-horizontal-menu "dev-master"

or add

"host33/yii2-multilevel-horizontal-menu": "dev-master"

to the require section of your composer.json file.

Usage

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

use host33\multilevelhorizontalmenu\MultilevelHorizontalMenu;
echo MultilevelHorizontalMenu::widget(
array(
"menu"=>array(
  array("url"=>array(),
               "label"=>"Products",
          array("url"=>array(
                       "route"=>"/product/create"),
                       "label"=>"Create product",),
          array("url"=>array(
                      "route"=>"/product/list"),
                      "label"=>"Product List",),
          array("url"=>array(),
                       "label"=>"View Products",
          array("url"=>array(
                       "route"=>"/product/show",
                       "params"=>array("id"=>3),
                       "htmlOptions"=>array("title"=>"title")),
                       "label"=>"Product 3"),
            array("url"=>array(),
                         "label"=>"Product 4",
                array("url"=>array(
                             "route"=>"/product/show",
                             "params"=>array("id"=>5)),
                             "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(),
                       "label"=>"Clothes",
          array("url"=>array(
                       "route"=>"/product/men",
                       "params"=>array("id"=>3),
                       "htmlOptions"=>array("title"=>"title")),
                       "label"=>"Men"),
            array("url"=>array(),
                         "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),
                )
          ),
)
);

Next, you have to add this other piece of code where you want the combobox menu to appear when the user shrink the window:

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

License

yii2-multilevel-horizontal-menu is released under the BSD 3-Clause License. See the bundled LICENSE.md for details.

yii2-multilevel-horizontal-menu's People

Contributors

oligalma avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.