Download the PHP package dlds/yii2-nested-sets without Composer
On this page you can find all versions of the php package dlds/yii2-nested-sets. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dlds/yii2-nested-sets
More information about dlds/yii2-nested-sets
Files in dlds/yii2-nested-sets
Package yii2-nested-sets
Short Description The nested sets behavior for the Yii framework
License BSD-3-Clause
Informations about the package yii2-nested-sets
Yii 2 Nested Sets Behavior
A modern nested sets behavior for the Yii2 framework utilizing the Modified Preorder Tree Traversal algorithm.
Installation
The preferred way to install this extension is through composer.
Either run
or add
to the require
section of your composer.json
file.
Configuring
Configure model as follows
To use multiple tree mode uncomment treeAttribute
array key inside behaviors()
method.
Configure query class as follows
Usage
Making a root node
To make a root node
The tree will look like this
Prepending a node as the first child of another node
To prepend a node as the first child of another node
The tree will look like this
Appending a node as the last child of another node
To append a node as the last child of another node
The tree will look like this
Inserting a node before another node
To insert a node before another node
The tree will look like this
Inserting a node after another node
To insert a node after another node
The tree will look like this
Getting the root nodes
To get all the root nodes
Getting the leaves nodes
To get all the leaves nodes
To get all the leaves of a node
Getting children of a node
To get all the children of a node
To get the first level children of a node
Getting parents of a node
To get all the parents of a node
To get the first parent of a node