Skip to content

cybercog/yii2-ztree

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ztree

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'=>'USA','children'=>[
            ['name'=>'Moscow'],
            ['name'=>'Orenburg'],
            ['name'=>'Omsk'],
            ['name'=>'Samara'],
        ]],
    ]
]]);
?>```

About

The zTree extension for the Yii framework

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published

Languages

  • CSS 72.8%
  • PHP 27.2%