singrana/yii2-suffixtree-behavior

Behavior for use suffix tree

dev-master 2014-05-13 07:43 UTC

This package is not auto-updated.

Last update: 2024-05-07 00:49:49 UTC


README

Behavior for use suffix tree. This behavior attached to your model for usage hierarchical structure.

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist singrana/yii2-suffixtree-behavior "*"

or add

"singrana/yii2-suffixtree-behavior": "*"

to the require section of your composer.json file.

Usage

Once the extension is installed, simply use it in your code by :

Add in your model behaviors method:

public function behaviors()
{
	return
	[
		...

		'suffixTree'		=>
		[
			'class'			=>	'singrana\behaviors\SuffixBehavior',
		],
		...
	];
}

You can configure behavior:

  • fieldKey - attribute for storage suffix key;
  • fieldTranslit - attribute for storage translit, null if not need;
  • fieldUrl - attribute for storage Url, null if not need;
  • fieldParent - attribute for storage parent field, null if not need different trees storage;
  • fieldParentId - attribute for parent node Id;
  • fieldLevel - attribute for storage level node, null if not need;