sitronik / yii2-tree-menu
Tree menu for yii2 framework
Installs: 397
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 0
Open Issues: 0
Type:yii2-extension
pkg:composer/sitronik/yii2-tree-menu
Requires
- yiisoft/yii2: *
This package is not auto-updated.
Last update: 2025-10-26 08:13:21 UTC
README
Installation
The preferred way to install this extension is through composer.
Either run
$ php composer.phar require sitronik/yii2-tree-menu "@dev"
or add
"sitronik/yii2-tree-menu": "@dev"
to the require section of your composer.json file.
Usage
Step 1: Prepare Database
Create your database table to store the tree structure. You can do it in this way:
Run DB Migrations
You can run the migrations script provided to create the database structure from your yii programming console:
php yii migrate/up --migrationPath=@vendor/sitronik/yii2-tree-menu/migrations
Step 2: Setup Module
Configure the module named treemenu in the modules section of your Yii configuration file.
'modules' => [ 'treemenu' => [ 'class' => 'sitronik\treemenu\Module', ] ]
Step 3: Using Tree Widget
In your view files, you can now use the tree widget directly to manage tree data as shown below:
echo sitronik\treemenu\Tree::widget();
Step 4: Manage Tree Widget
Go to /treemenu and manage your tree
License
yii2-tree-menu is released under the BSD 3-Clause License. See the bundled LICENSE.md for details.

