webdev-sv / yii2-jstree-widget

Widget for Yii Framework 2.0 to use JsTree

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

yii2-jstree

Widget for Yii Framework 2.0 to use JsTree

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist thiagotalma/yii2-jstree "*"

or add

"thiagotalma/yii2-jstree": "*"

to the require section of your composer.json file.

Usage

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

<?=  \talma\widgets\JsTree::widget([
    'attribute' => 'attribute_name',
    'model' => $model,
    'core' => [
        'data' => $data
        ...
    ],
    'plugins' => ['types', 'dnd', 'contextmenu', 'wholerow', 'state'],
    ...
]); ?>

Usage without a model (you must specify the "name" attribute) :

<?=  \talma\widgets\JsTree::widget([
    'name' => 'js_tree',
    'core' => [
        'data' => $data
        ...
    ],
    'plugins' => ['types', 'dnd', 'contextmenu', 'wholerow', 'state'],
    ...
]); ?>

About

Widget for Yii Framework 2.0 to use JsTree

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:PHP 100.0%