l3pp4rd/DoctrineExtensions — pull request #359 by zhil (2012-06-07 19:20:31+00:00)
Title: Closures on close option

I need to show unlimited level tree as 2 levels "preview" three and I need closures in close options. I use decorator options like

array('decorate' => true,
'rootOpen' => function($tree) {
if(count($tree) && ($tree[0]['lvl'] == 0)){
return '

';
}
},
'rootClose' => function($child) {
if(count($child) && ($child[0]['lvl'] == 0)){
return '

';
}
},
'childOpen' => '',
'childClose' => '',
'nodeDecorator' => function($node) {
if($node['lvl'] == 1) {
return '

'.$node['title'].'

';
}elseif($node["isVisibleOnHome"]) {
return ''.$node['title'].' ';
}
}