PHP code example of gudezi / yii2-fancytree-widget

1. Go to this page and download the library: Download gudezi/yii2-fancytree-widget 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/ */

    

gudezi / yii2-fancytree-widget example snippets




// Example of data.
$data = [
	['title' => 'Node 1', 'key' => 1],
	['title' => 'Folder 2', 'key' => '2', 'folder' => true, 'children' => [
		['title' => 'Node 2.1', 'key' => '3'],
		['title' => 'Node 2.2', 'key' => '4']
	]]
];

 <?= $form->field($model, 'attribute')->widget(FancytreeWidget::classname(), [
            'name' => 'fancytree',
            'source' => $data,
            'parent' =>$id // parent category id (if exist)
            'options' => [
            ],
        ]); 

php composer.phar