Re: Recursive sections
| From: | Bertrand DUNOGIER | Date: | Thu, 28 Feb 2002 14:52:49 +0000 |
| Subject: | Re: Recursive sections | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-2894@lists.php.net to get a copy of this message | ||
BD> i'm working on a template which displays a folder tree from a
BD> multidimensionnal array.
BD> I use a template which looks like this:
BD> {section name=tree loop=$FOLDERS_TREE}
BD> {$FOLDERS_TREE[tree].level|multiplify:"<img
BD> src='/gfx/foldertree/vertical.gif'>"}<img
BD> src='/gfx/foldertree/plus.gif'><a
BD>
BD> href='{$FOLDERS_TREE[tree].link}'>{$FOLDERS_TREE[tree].label}</a><br>
BD> {if $FOLDERS_TREE[tree].tree}{include file=images/folderstree.tpl
BD> FOLDERS_TREE=$FOLDERS_TREE[tree].tree}{/if}
BD> {/section}
BD> The problem is that it only displays one level...
BD> it is probably a variable scope issue but i don't have time to dive
BD> into the code right now...
BD> any way i could fix this ?
In fact i've got it running using a foreach loop. Quite logical, in
fact.
Thanks :)
Bertrand