diselop / yii2-ztree
The zTree extension for the Yii framework
Package info
Language:CSS
Type:yii2-extension
pkg:composer/diselop/yii2-ztree
dev-master
2015-05-20 05:52 UTC
Requires
- yiisoft/yii2: *
This package is not auto-updated.
Last update: 2026-04-12 01:47:49 UTC
README
zTree is a multi-functional 'tree plug-ins.'
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist diselop/yii2-ztree "*"
or add
"diselop/yii2-ztree": "*"
to the require section of your composer.json file.
Usage
Once the extension is installed, simply use it in your code by :
<?= \diselop\ztree\Ztree::widget(['nodes'=>[ 'name'=>'cities','children'=>[ ['name'=>'USA','children'=>[ ['name'=>'New York'], ['name'=>'Los Angeles'], ['name'=>'Chicago'], ['name'=>'San Diego'], ]], ['name'=>'China','children'=>[ ['name'=>'Beijing'], ['name'=>'Shanghai'], ['name'=>'Shenzhen'], ['name'=>'Gaozhou'], ]], ['name'=>'Russia','children'=>[ ['name'=>'Moscow'], ['name'=>'Orenburg'], ['name'=>'Omsk'], ['name'=>'Samara'], ]], ] ]]); ?>