johnproza / yii2-menu
Dynamic menu
Installs: 20
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 1
Open Issues: 0
Type:yii2-extension
Requires
- yiisoft/yii2: ~2.0.0
- yiisoft/yii2-bootstrap4: @dev
This package is auto-updated.
Last update: 2025-05-04 21:39:05 UTC
README
Dynamic menu and html content with TinyMCE editor
You also can assign menu to item (dynamic and static menu)
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist johnproza/yii2-menu "*"
or add
"johnproza/yii2-menu": "*"
to the require section of your composer.json
file.
Usage
Before using you must prepare database
php yii migrate --migrationPath=@vendor/johnproza/yii2-menu/migrations
Config extension
Use it in your code:
'menu' => [ 'class' => 'oboom\menu\Module', ]
Widget usage
Insert into your view file to show menu in frontend
use oboom\menu\widgets\Menu; ..... ..... <?=Menu::widget([ 'menuId'=>1, // menu id 'itemId'=>$item->id, // id of item. This is check, how to assign menu into item 'level'=>1, //menu level 'className'=>'header' // css class name ]) ?>
Insert into your view file to show categories in backend
use oboom\menu\widgets\MenuList; ..... ..... <?=MenuList::widget()?>