Widget for Yii Framework 2.0 to use JsTree
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist lav45/yii2-jstree "1.0.*"
or add
"lav45/yii2-jstree": "1.0.*"
to the require section of your composer.json
file.
Once the extension is installed, simply use it in your code by :
use lav45\widget\JsTree;
<?= JsTree::widget([
'clientOptions' => [
'core' => [
'data' => $data
// ...
],
'plugins' => ['types', 'dnd', 'contextmenu', 'wholerow', 'state'],
// ...
]
]); ?>