[prev in list] [next in list] [prev in thread] [next in thread]
List: smarty-general
Subject: Re: [SMARTY] evaluate data recursive
From: Patrick Pletscher <debian () galaxysoft ! ch>
Date: 2004-01-31 15:12:32
Message-ID: 1075561952.1047.10.camel () erde
[Download RAW message or body]
Hello,
> Hello,
>
> without any plugins or extensions the only way I know to do recursion
> inside the template is to recursively include a template. Something
> like:
>
> [menu.tpl]
> {$item->name}
> {foreach from=$item->childs item=child}
> {include file="menu.tpl" item=$child}
> {/foreach}
>
>
Thanks for your reply. I guess this would work quite well for my
purpose, except, that I should know how deep I am in the recursion for
putting spaces ( ) in front of the links.
Is there a plan to include a Smarty function which could look like this:
{recursive from=$variable item=new type=preorder|inorder|postorder
recursive_for=$variable->childs name=my_recursion}
{smarty.my_recursion.depth} {new->name}
{/recursive}
Because recursive datastructres are quite usefull in many areas of
computer science I think it would be a great feature if smarty could
include a function for handling them...
Or is such a plugin written easily, I didn't know that, because I never
had the need to write a smarty-plugin
Sincerly, Patrick
--
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic