Download the PHP package kr0lik/yii2-tree-manager without Composer
On this page you can find all versions of the php package kr0lik/yii2-tree-manager. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kr0lik/yii2-tree-manager
More information about kr0lik/yii2-tree-manager
Files in kr0lik/yii2-tree-manager
Package yii2-tree-manager
Short Description Yii2 widget for manage tree using fancytree
License MIT
Informations about the package yii2-tree-manager
yii2-tree-manager
Yii2 tree manager using fancytree library.
This extension can add/delete/move branches of tree and quick edit branch fields.
Installation
The preferred way to install this extension is through composer.
Either run
to the require section of your composer.json
file.
Description
Extension will install fancytree library, yii2-jquery, yii2-jqueryui and yii2-bootstrap.
You can with any tree extensions, just implement kr0lik\tree\contracts\TreeModelInterface
Required fileds in model: id
.
Usage
First implement kr0lik\tree\contracts\TreeModelInterface
in Model.
Tree Manager
Add kr0lik\tree\TreeManagerAction
into controller.
Required options:
- treeModelClass - tree model class.
Optional:
- bsVersion: int - Bootstrap version. Default 3.
- formViewPath - Path to form view.
- formNameField - Field with name of node. Default:
name
. - formFields - Array of additional edit fields (ex: body or description). It can be string or callable.
- formLinks - Array of links (ex: link to view page or edit page). It can be string or callable.
Example:
Add kr0lik\tree\TreeManagerWidget
into view.
Required options:
- pathAction - Url to tree model backend action.
Optional:
- bsVersion: int - Bootstrap version. Default 3.
- treeOptions: array - Container tag options.
- multipleRoots: bool - Allow multiple roots. Default: false.
- activeId: int - ID active node by default.
- dndEnable: bool - for dissable drag and drop set null or false. Default: true.
- viewPath - path to view of manager.
- firstRootActivateDefault - Activate first root on load if no activeId. Default: true.
- buttons - Array of additional buttons(as Html).
Events:
Tree Input
Add kr0lik\tree\TreeAction
into controller.
Required options:
- treeModelClass - tree model class.
Example:
Add kr0lik\tree\TreeInput
into view.
Required options:
- pathAction - Url to tree model backend action.
Optional:
- bsVersion: int - Bootstrap version. Default 3.
- treeOptions: array - Container tag options.
- leavesOnly: bool - Select only endpoint nodes. Default: true.
- multiple: bool - Select multiple nodes. Default: false.
- options: array - input options.
- viewPath: string - path to view of input.
- collapse: bool - collapse tree. Default: true.
Example:
Events:
Tree Relations Input
Add kr0lik\tree\TreeRelationAction
into controller.
Required options:
- treeModelClass - tree model class.
- relationModelClass - tree relaion model class.
Example:
Add kr0lik\tree\TreeRelationInput
into view.
Required options:
- pathAction - Url to tree model backend action.
Optional:
- bsVersion: int - Bootstrap version. Default 3.
- treeOptions: array - Container tag options.
- leavesOnly: bool - Select only endpoint nodes. Default: true.
- multiple: bool - Select multiple nodes. Default: false.
- options: array - input options.
- viewPath: string - path to view of input.
- collapse: bool - collapse tree. Default: true.
Example:
Events:
Internationalization
All text and messages introduced in this extension are translatable under category 'kr0lik.tree'. You may use translations provided within this extension, using following application configuration:
Global bootstrap version
You can specify bootstrap version for tree-manager globaly by adding bsVersion option in yii params (e.g. config/params.php):
All versions of yii2-tree-manager with dependencies
yiisoft/yii2 Version ^2.0
yiisoft/yii2-jui Version ~2.0.0
bower-asset/fancytree Version ^2.35