Re: Re[2]: [SMARTY] Recursion, include, and {section}

From: Date: Tue, 30 Jul 2002 21:22:00 +0000
Subject: Re: Re[2]: [SMARTY] Recursion, include, and {section}
References: 1 2 3 4 5  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-5520@lists.php.net to get a copy of this message
On Tue, 30 Jul 2002 22:56:55 +0200 Bertrand DUNOGIER <bdunogier@wanadoo.fr> wrote: > KY> I'll try it, but it seems on its face to be no different. > KY> The manual says that nested {foreach} loops need distinct > KY> names, too, and you haven't done that here. > Hmmm, i'm amazed, since it works perfectly. If i'm not wrong, when > you set a parameter using param=value in the {include} tag, this > parameter is considered as local scope for the include. So you get > a different variable in every instance of the included file. Well, heck and durn, it seems to work here, too. Sure seems odd, but I'm not going to complain. I'd like to hear from Monte et al as to whether this feature is intentional, in that it will continue to work in future revisions of Smarty... > Even if $ARRAY_TREE exists in the parent template, it looks like > the one given as a parameter to the include overwrites this one, > so it works. In fact, it is not exactly nested foreach loops, > but rather nested includes... it's not exactly the same thing. The problem I was having was not with the loop variable for the {section}, but the section name. The loop variable was being correctly overridden in each iteration, but the section name was the same each time, so the iteration of an interior loop messed up that of the outer loop, even though they were at different include levels. > You can see a screenshot of this tree on: > http://www.katana-inc.com/screenshots/CMS.png. > There is no online version of this tool available at the time being. Thanks a ton for the tip!! Ken -- Ken Yarnall Dept. of Mathematical Sciences Lebanon Valley College Assoc. Professor of Math and CS (717)867-6085 yarnall@lvc.edu

« previous php.smarty.general (#5520) next »