Re: [PHP Template] Looping and nested sections

[email protected] (Andrei Zmievski) Tue, 29 Feb 2000 08:15:01 -0600
Newsgroups php.template
Message-ID <[email protected]>
So, does this mean that $foo would be re-looped inside sec2? What if you
refer to $sec3:bar and $sec3 has not been executed yet?

Just thinking maybe we should keep ':' for future extensions? :) It's
such a nice delimiter.

On Mon, 28 Feb 2000, Dan Libby wrote:
> I like this approach.  It is very inheritance-esque and even allows you to reference
> the value 3 levels up if you
> want.  It also doesn't change the semantics of what a section is, depending on
> context.  I don't have anything to add.
> >
> > example:
> >
> > {{section sec1}}
> >         ...
> >         {{ $foo }}
> >         {{ $sec1:foo }}      <!-- prints the same variable as $foo -->
> >          ...
> >         {{section sec2}}
> >                 ...
> >                 {{ $foo }}
> >                 {{ $sec2:foo }} <!-- prints the same variable as $foo -->
> >                 {{ $sec1:foo }} <!-- prints value of outer section foo variable -->
> >                  ...
> >         {/section}}
> > {{/section}}


-Andrei

"Claiming Java is easier than C++ is like
 saying that K2 is shorter than Everest." 
 -- Larry O'Brien (editor, Software Development)