yongtiger/yii2-category

Allows user to create multilevel category from their desire table for the Yii2.

v0.0.14 2017-12-17 06:06 UTC

README

Allows user to create multilevel category from their desire table for the Yii2.

Latest Stable Version Total Downloads Latest Unstable Version License

FEATURES

  • Create Unlimited Multilevel categories
  • Complete category management (create, update, delete, deleteAll, etc.)
  • Visualize category tree structure

DEPENDENCES

INSTALLATION

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist yongtiger/yii2-category "*"

or add

"yongtiger/yii2-category": "*"

to the require section of your composer.json.

CONFIGURATION

Module category

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

Module treemanager

'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',
	],
	// ...
],

USAGES

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

NOTES

DOCUMENTS

REFERENCES

SEE ALSO

TBD

Development roadmap

LICENSE

yii2-category is released under the MIT license, see LICENSE file for details.