PHP code example of pcrt / yii2-treeview

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

    

pcrt / yii2-treeview example snippets


use pcrt\widgets\treeview\Treeview:


// with \yii\bootstrap\ActiveForm;
echo $form
    ->field($model, 'attribute')
    ->widget(
        Treeview::class,
        [
          'clientOptions' => [
            'source' => "http://www.xxxxx.it/out.json",
          ]
        ]
    );

// as widget
echo Treeview::widget([
    'id'=>'treeview',
    'name'=>'treeview',
    'clientOptions' => [
      'source' => "http://www.xxxxx.it/out.json",
    ]
]);

$ php composer.phar