Re: [SMARTY] Recursion, include, and {section}
| From: | Ken Yarnall | Date: | Tue, 30 Jul 2002 20:47:40 +0000 |
| Subject: | Re: [SMARTY] Recursion, include, and {section} | ||
| References: | 1 2 3 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-5518@lists.php.net to get a copy of this message | ||
On Tue, 30 Jul 2002 22:17:35 +0200
Bertrand DUNOGIER <bdunogier@wanadoo.fr> wrote:
> KY> Problem is, the template contains a named {section}, and
> KY> the recursive include is inside that {section}. This results in
> KY> nested sections with the same name. This is futzing up the
> KY> loops, as the Smarty manual predicts.
> I managed to fix this using foreach and a local variable in
> my{include}. Something like:
>
> {foreach from=$TREE_ARRAY item=TREE}
> ...
> {include file=$SELF TREE_ARRAY=$TREE_ARRAY.tree}
> ...
> {/foreach}
>
> ($TREE_ARRAY.tree contains each time exactly the same structure,
> of course)
I'll try it, but it seems on its face to be no different. The manual
says that nested {foreach} loops need distinct names, too, and you
haven't done that here.
Ken
--
Ken Yarnall
Dept. of Mathematical Sciences Lebanon Valley College
Assoc. Professor of Math and CS (717)867-6085 yarnall@lvc.edu