PHP code example of yongtiger / yii2-category

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

    

yongtiger / yii2-category example snippets


'modules' => [
	'category' => [
	    'class' => 'yongtiger\category\Module',
	    'tableName' => '{{%category_nested_sets}}',
	    // 'tableName' => '{{%category_adjacency_list}}',
	],
	// ...
],

'modules' => [
	'treemanager' => [
	    'class' => 'yongtiger\tree\Module',
	    'behaviors' => [
	        'tree' => [
	            'class' => \creocoder\nestedsets\NestedSetsBehavior::className(),
	            // 'class' => \paulzi\nestedsets\NestedSetsBehavior::className(),
	            ///To disable the `creocoder/yii2-nested-sets` multiple tree, set to `false`. @see https://github.com/creocoder/yii2-nested-sets
	            ///To disable the `paulzi/yii2-nested-sets` multiple tree, set to `null`. @see https://github.com/paulzi/yii2-nested-sets
	            'treeAttribute' => 'tree',  ///multiple tree mode for nested-sets 
	            // 'leftAttribute' => 'lft',
	            // 'rightAttribute' => 'rgt',
	            // 'depthAttribute' => 'depth',
	        ],
	        // 'tree' => [
	        //     'class' => \paulzi\adjacencyList\AdjacencyListBehavior::className(),
	        // ],
	    ],
	    // 'isOpAllTransactions' => false,  ///Must set to `true` while using `creocoder/yii2-nested-sets` and `paulzi/yii2-nested-sets`.
	    // 'queryClass' => 'common\models\CategoryQuery',
	],
	// ...
],

php composer.phar 

http://localhost/index.php?r=category