yii2-menu Creating links, drop menus, line (diver) in the navbar-left and/or navbar-right

Menu menager for Yii2

  1. Features
  2. Installation
  3. Configuration

Menu builder DEMO

Features

  • Creating and menagment navbar-left and/or navbar-right
  • Sorting, editing, and deleting elements using drag and drop method
  • CRUD operations by jQuery Ajax)
  • No jQuery for drag and drop (RubaXa/Sortable)

Installation

composer require pceuropa/yii2-menu dev-master

Add the following code to config file Yii2 (config/web.php or exp. config/main.php)

'modules' => [
	'menu' => [
            'class' => '\pceuropa\menu\Module',
        ],
	]

Configuration

1. Create database schema (table menu)

Make sure that you have properly configured db application component and run the following command:

$ php yii migrate/up --migrationPath=@vendor/pceuropa/yii2-menu/migrations
2. Add the following code to config file Yii2
use pceuropa\menu\Menu;

NavBar::begin(['brandLabel' => 'Brand','brandUrl' => Url::home(),]);

echo Nav::widget([ 'options' => ['class' => 'navbar-nav navbar-left'],
                    'items' => Menu::NavbarLeft(1)  // argument is id of menu
                ]); 

echo Nav::widget([ 'options' => ['class' => 'navbar-nav navbar-right'],
                    'items' => Menu::NavbarRight(1)
                ]);
NavBar::end();

Author: Rafal Marguzewicz| Donation

0 0
4 followers
0 downloads
Yii Version: 2.0
License: MIT
Category: User Interface
Developed by: pceuropa
Created on: Dec 18, 2015
Last updated: 7 years ago

Related Extensions