https://github.com/zacksleo/yii2-menu
Personalized bootstrap menu menager for framework Yii2 -
https://github.com/zacksleo/yii2-menu
Last synced: 5 months ago
JSON representation
Personalized bootstrap menu menager for framework Yii2 -
- Host: GitHub
- URL: https://github.com/zacksleo/yii2-menu
- Owner: zacksleo
- License: mit
- Fork: true (pceuropa/yii2-menu)
- Created: 2016-11-07T07:10:39.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-11-07T09:15:32.000Z (over 9 years ago)
- Last Synced: 2025-08-09T03:59:30.666Z (11 months ago)
- Language: JavaScript
- Homepage: http://yii2-menu.pceuropa.net
- Size: 46.9 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://packagist.org/packages/pceuropa/yii2-menu) [](https://packagist.org/packages/pceuropa/yii2-menu) [](https://packagist.org/packages/pceuropa/yii2-menu) [](https://packagist.org/packages/pceuropa/yii2-menu)
Bootstrap Menu Builder for Yii2
============================

[DEMO](http://yii2-menu.pceuropa.net/menu/creator/)
## 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](https://github.com/RubaXa/Sortable))
* CRUD operations by jQuery Ajax)
## Installation
```
composer require zacksleo/yii2-menu dev-master
```
Add the following code to config file Yii2
```php
'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:
```bash
$ php yii migrate/up --migrationPath=@vendor/zacksleo/yii2-menu/migrations
```
### 2. Add the following code to config file Yii2
```php
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