dasturchiuz / yii2-nested-sets-tree-behavior

yii2-nested-sets-tree-behavior

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NestedSetsTreeBehavior

NestedSetsTreeBehavior this is the connector between https://github.com/creocoder/yii2-nested-sets and https://github.com/wbraganca/yii2-fancytree-widget

Installation

The preferred way to install this extension is through composer.

Either run

composer require dasturchiuz/yii2-nested-sets-tree-behavior

or add

"dasturchiuz/yii2-nested-sets-tree-behavior": "*"

to the require section of your composer.json file.

Usage

Once the extension is installed, simply use it in your model :

'htmlTreeCategory'=>[
    'class' => \dasturchiuz\treebehavior\NestedSetsTreeBehavior::className()
]

use

SomeModel::findOne($id)->treeCategory()

to get arrays

About

yii2-nested-sets-tree-behavior


Languages

Language:PHP 100.0%