johnproza/yii2-menu

Dynamic menu

Installs: 20

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 1

Open Issues: 0

Type:yii2-extension

dev-master 2020-06-04 10:32 UTC

This package is auto-updated.

Last update: 2024-09-04 20:14:18 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()?>