2017 © Pedro PelĂĄez
 

yii2-extension yii2-menu

DataBase loader with menu items for Kartik Menu Widget.

image

cyneek/yii2-menu

DataBase loader with menu items for Kartik Menu Widget.

  • Sunday, July 19, 2015
  • by Patroklo
  • Repository
  • 3 Watchers
  • 1 Stars
  • 138 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 1 Versions
  • 5 % Grown

The README.md

Yii2 Menu Widget

Menu widget that loads Kartik sidenav widget with database items., (*1)

What's Menu Widget?

This widget gets from database a group of ordered and hierarchical items and loads them into the Kartik sidevan widget., (*2)

Developed by Joseba JuĂĄniz (@Patroklo), (*3)

Minimum requirements

  • Yii2
  • Php 5.4 or above

Future plans

  • None right now.

License

This is free software. It is released under the terms of the following BSD License., (*4)

Copyright (c) 2014, by Cyneek All rights reserved., (*5)

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of Cyneek nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission., (*6)

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE., (*7)

Instalation

  • Install Yii 2
  • Install package via composer, (*8)

    "cyneek/yii2-menu": "dev-master"
  • Launch the migration, (*9)

     php yii migrate --migrationPath=@vendor/cyneek/yii2-menu/migrations
  • Profit!, (*10)

Widget definition

The first step is to fill the menu table with a menu structure. This can be achieved with the built-in methods of the MenuItems ActiveRecord:, (*11)

add_menu_item

  • label (String) (obligatory), (*12)

    Defines the text that will be shown for this menu item in the SideNav Widget., (*13)

  • url (String) (optional), (*14)

    The url where the menu item will link in the sidenav., (*15)

  • parent (String) (optional), (*16)

    Name of the parent menu item. This will create a hierarchical menu., (*17)

  • name (String) (optional), (*18)

    Name of the menu item, if not defined, will use the label text., (*19)

  • icon (String) (optional), (*20)

    CSS Bootstrap icon name that will be shown next to the menu item text., (*21)

  • options (String) (optional), (*22)

    HTML Options that will be added into the menu item., (*23)

  • visible (String) (optional), (*24)

    If 0, the menu item and all its children won't be shown at the sidenav., (*25)

delete_menu_item

Warning: It deletes the menu item and all its children., (*26)

  • name (String) (obligatory) > Name of the menu item, that will be deleted.

hide_menu_item

Warning: This will hide the menu item and all its children., (*27)

  • name (String) (obligatory)

show_menu_item

  • name (String) (obligatory)

Widget use

    echo \cyneek\yii2\menu\Menu::widget($options);

Options is an array as defined in the Kartik Sidenav Widget Options., (*28)

The Versions

19/07 2015

dev-master

9999999-dev

DataBase loader with menu items for Kartik Menu Widget.

  Sources   Download

BSD

The Requires

 

yii2 widget menu