zacksleo / yii2-menu
Menu bootstrap creator/builder. Sort by drag and drop
Installs: 36
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 4
Forks: 17
Language:JavaScript
Type:yii2-extension
This package is auto-updated.
Last update: 2024-11-08 07:09:11 UTC
README
Bootstrap Menu Builder for Yii2
Features
- Creating links, drop menus, line (diver) in the navbar-left and/or navbar-right
- Sorting, editing, and deleting using drag and drop
- No jQuery for drag and drop (RubaXa/Sortable)
- CRUD operations by jQuery Ajax)
Installation
composer require zacksleo/yii2-menu dev-master
Add the following code to config file Yii2
'modules' => [ 'menu' => [ 'class' => '\zacksleo\menu\Menu', ], ]
Configuration
1. Create database schema
Make sure that you have properly configured db
application component
and run the following command:
$ php yii migrate/up --migrationPath=@vendor/zacksleo/yii2-menu/migrations
2. Add the following code to config file Yii2
use zacksleo\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();
3. Getting started
example.com/menu/creator