PHP code example of forecho / yii2-jqtree

1. Go to this page and download the library: Download forecho/yii2-jqtree library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

forecho / yii2-jqtree example snippets



use forecho\jqtree\JQTree;

$dataTree = [
    [
        'label' => 'node1',
        'children' => array(
            ['label' => 'child1'],
            ['label' => 'child2'],
        ),
    ],
    ['label' => 'node2'],
];

echo JQTree::widget([
    'id' => 'treeview',
    'data' => $dataTree,
    'dragAndDrop' => true,
    'selectable' => true,
    'saveState' => true,
    'autoOpen' => true,
    'htmlOptions' => ['class' => 'treeview-red']
]) 

php composer.phar