Wallogit.com
2017 © Pedro Peláez
Behavior for use suffix tree
Behavior for use suffix tree. This behavior attached to your model for usage hierarchical structure., (*1)
The preferred way to install this extension is through composer., (*2)
Either run, (*3)
php composer.phar require --prefer-dist singrana/yii2-suffixtree-behavior "*"
or add, (*4)
"singrana/yii2-suffixtree-behavior": "*"
to the require section of your composer.json file., (*5)
Once the extension is installed, simply use it in your code by :, (*6)
Add in your model behaviors method:, (*7)
public function behaviors()
{
return
[
...
'suffixTree' =>
[
'class' => 'singrana\behaviors\SuffixBehavior',
],
...
];
}
You can configure behavior:, (*8)
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;