Quantcast
Channel: Live News for Yii Framework
Viewing all articles
Browse latest Browse all 3375

[extension] startpl/yii2-nested-sets-menu

$
0
0

Nested Sets Menu Widget

  1. Installation
  2. Usage

Widget to display nested sets as Menu

PackagistPackagist 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: `php

  • <?= 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

Viewing all articles
Browse latest Browse all 3375

Trending Articles