N
N
nepster-web2013-12-09 21:24:49
Yii
nepster-web, 2013-12-09 21:24:49

Materialized Path Tree Behavior Yii, documentation?

Has anyone used this script?
https://github.com/matperez/yii-ac-materialized-pa...
Is there any documentation for it, it's not clear how to use it! =(

Answer the question

In order to leave comments, you need to log in

3 answer(s)
_
_ _, 2013-12-10
@nepster-web

And everything just happens there, I collected the same thing for myself on my knee.
This is a tree in which the elements, in addition to the parent id, contain a string of parent identifiers, sorted by nesting level. Example - you have a tree of elements:
1, Category
3, Subcategory
5, Lower Category
Then each of the elements will have an additional text field, like this
1, Category, 1
3, Subcategory, 1.3
5, Lower Category, 1.3.5
What this gives is the ability to quickly select elements of the branches of the tree, both up and down. If you want to know all the parents of the Lower category element, you do IN (1,3) where 1,3 is explode('.', '1.3.5') minus the last element, if you want to know all children of the Category element, then do LIKE '%1.%'.
Plus, there is an additional field position, for arranging elements within a single node of the tree.

D
Damir Makhmutov, 2013-12-09
@doodoo

Write to the author, ask if you can't figure out what's going on there. Right on the github, you can create an issue with a question. And so, the author googles one or two)

A
Alexander Gubarev, 2014-12-30
@AlexGx

There is some information on the project's github in issues https://github.com/matperez/yii-ac-materialized-pa... and judging by the comments, there are unfixed bugs.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question