Thanks for your help, it works :)
For those who are interested, here it is : http://gist.github.com/292543
Cheers !
Le 1 févr. 2010 à 16:57, Bernhard Schussek a écrit :
> You could, for instance, write a recursive render helper:
>
> function render_nested_set(Doctrine_Collection $collection)
>
Problème is, I want my rendering to follow a path, as you can see in my
"example".
Anyway, a recursive render helper is a good start I guess!
Maybe I should add a 'path' parameter helper to make something like :
function render_nested_set(Doctrine_Collection $collection, array $path)
{
// ...
}
You could, for instance, write a recursive render helper:
function render_nested_set(Doctrine_Collection $collection)
{
$output = "\n";
foreach ($collection as $record)
{
$output .= "".$record; // __toString(), or whatever you like
if ($record->getNode()->hasChildren())
{
Hi there,
I'm heavily working w/ Doctrine NestedSet behavior. I have a tree I'd like to
render in a complex way.
Let say I have a path for my selected node : node1 > node2 > node3
I'd like to render it so I can display :
node 1 sibling 1
node 1 sibling 2
node 1 sibling 3
node 1
node