Re: [PHP Template] Looping and nested sections
| From: | Andrei Zmievski | Date: | Wed, 01 Mar 2000 03:38:36 +0000 |
| Subject: | Re: [PHP Template] Looping and nested sections | ||
| References: | 1 2 3 4 | Groups: | php.template |
| Request: | Send a blank email to php-template+get-263@lists.php.net to get a copy of this message | ||
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