[PHPTAL] Recursive Output

lbedubourg lbedubourg at motion-twin.com
Fri Jul 13 08:39:55 CEST 2007


Werner wrote:
> Hi,
> 
> Is there any known way to handle the needed recursive output of nested 
> objects/arrays?
> 

You can use macros (see metal section in the manual)

> For example, suppose you have a Menu object that has an Items properties 
> (array of items) and it can also have another Menu object as its 
> ChildMenu property. Is it possible to output all menu items without 
> knowing the nesting (depth) levels beforehand?
> 

Inded macros can do that.

Regards
Laurent



More information about the PHPTAL mailing list