On Sep 19, 4:06 pm, guigouz <[EMAIL PROTECTED]> wrote:
> Hi,
>  I'm playing with the tree behaviour and trying to attach a tree to
> another Model. For example, a Post has many Comments, where Comments
> is a tree.
>  When I fetch the Comments with findAllThreaded() the tree comes
> fine.. is there any way to attach this to the association ?

I'd recommend having a post_id in each comment and define in your Post
hasMany Comment association order by lft ASC. Using the tree behavior
and findAllThreaded together shouldn't really be necessary.

There is a tree helper I wrote floating around (you can get an older
version of it from the tree demo source in the noswad cakeforge
project) that you can then use to generate your nested output.

hth,

AD


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to