Re: [PHP Template] Looping and nested sections

[email protected] (Andrei Zmievski) Tue, 29 Feb 2000 21:38:36 -0600
Newsgroups php.template
Message-ID <[email protected]>
At 04:02 PM 2/29/00 -0800, Dan Libby wrote:
>No, it is referring to the scalar value of $foo as it exists in the current 
>iteration of
>sec2.  If you refer to a section that has not been executed yet, then it is 
>undefined like
>any other undefined var, with the same behavior.

I've thought a lot today about looping and sections and repeating values.
I'll post a full write up a liitle later, but basically when you have this
situation:

{{ section sec1 }}
	{{ $foo }}
	{{ section sec2 }}
		{{ $foo }}
	{{ /section sec2 }}
{{ /section sec1 }}

and $foo has multiple values, by the time you get to sec2 there's no way to
know whether $foo refers to the current value from sec1 or to the current
value from sec2. So I think we should disambiguate it and use $sec1:foo or
something similar to refer to values in outer sections.


-Andrei