Download the PHP package arogachev/yii2-tree without Composer
On this page you can find all versions of the php package arogachev/yii2-tree. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download arogachev/yii2-tree
More information about arogachev/yii2-tree
Files in arogachev/yii2-tree
Package yii2-tree
Short Description Database tree structures management for Yii 2 framework
License BSD-3-Clause
Homepage https://github.com/arogachev/yii2-tree
Informations about the package yii2-tree
Yii 2 Tree
Database tree structures management for Yii 2 framework
Currently it's Nested Sets management extension based on:
Contents:
- Installation
- Features
- Usage
- Behavior configuration
- Widget configuration
Installation
The preferred way to install this extension is through composer.
Either run
or add
to the require section of your composer.json file.
Features
- Basic actions with tree nodes: creating, renaming, moving, deleting
- Saving state of nodes (opened / closed)
- Links for updating node
Usage
Add this to application config:
Attach additional behavior along with NestedSetsBehavior to your model:
The last step is display widget:
Behavior configuration
nameAttribute - string, the name of attribute storing the name of node. Defaults to name.
saveState - boolean, save state of nodes (opened / closed). Defaults to false.
isOpenedAttribute - string, the name of attribute storing if the node opened or closed.
Used together with saveState. Defaults to is_opened.
Widget configuration
modelClass - string, the full model class including namespace of managed model. Required.
updateUrl - string, url for updating model in separate page.
Will be processed by yii\helpers\Url::to().
jsTreeOptions - array, options for JsTree widget. Example:
All versions of yii2-tree with dependencies
creocoder/yii2-nested-sets Version 0.9.*
bower-asset/jstree Version *