Tree behavior for model and database

Hi all,

I can’t see in the documentation of Yii, something related to “Tree Behaviors”

I see this behavior in cakePhp Tree Behavior in cake

Is this kind of thing done in Yii or shall we implement it by ourselves ?

Thanks

Hi

To get such data from db you should set relation for model to itself.

To display you can use http://www.yiiframework.com/doc/api/1.1/CTreeView

Thanks Vitalets,

I don’t know if we are talking about the same thing.

I’m talking about the way the tree relation ship could be done in database. Not tree widget for displaying results.

the way to represent tree relation ship in database could be done by adding parent_id in each subcategories or and it is better adding interval.

In french I know the term but I’m totally unaware to find good translation of this. (relation intervallaire)

I just have a look in cakePhp and this behavior is implemented in its Tree Behavior. And because I prefer Yii I had a look in the documentation and I was unable to find something like this.

And I just would like to know if I miss something in the doc or if I’m right and this behavior doesn’t exist in Yii

I think this is what you are looking for.

/Tommy

Hi,

maybe this is what you are searching for?

Hey !

[size="5"]Thanks guy.[/size]

Was EXACTLY I searched for (nested behavior was the correct translation)