startpl/yii2-nested-sets-menu

Widget to display nested sets as Menu

1.0.1 2020-03-11 06:13 UTC

This package is auto-updated.

Last update: 2024-11-24 15:35:33 UTC


README

Widget to display nested sets as Menu

Packagist Packagist Version

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist startpl/yii2-nested-sets-menu "*"

or add

"startpl/yii2-nested-sets-menu": "*"

to the require section of your composer.json file.

Usage

A basic usage looks like the following:

<?= Menu::widget([
    'items' => \startpl\yii2NestedSetsMenu\services\MenuArray::getData($data), // $data is your models|rows
    'options' => ['id'=>'main-menu', 'class' => 'menu'],
    'encodeLabels'=>false,
    'activateParents'=>true,
    'activeCssClass'=>'active',
]);?>

Also you can extending of MenuArray, NestedSetsTreeMenu for fine-tune your data