yii2-tree
Tree widget for Yii2 models, (*1)
Installation
The preferred way to install this extension is through composer., (*2)
Either run, (*3)
php composer.phar require --prefer-dist pendalf89/yii2-tree "*"
or add, (*4)
"pendalf89/yii2-tree": "*"
to the require section of your composer.json
file., (*5)
Usage
Once the extension is installed, simply use it in your code by :, (*6)
<?= TreeWidget::widget([
'models' => $models,
'value' => function($model) {
return $model->title;
}
]) ?>