Re: [PHP Template] Looping and nested sections

From: Date: Tue, 29 Feb 2000 14:15:01 +0000
Subject: Re: [PHP Template] Looping and nested sections
References: 1 2 3  Groups: php.template 
Request: Send a blank email to php-template+get-244@lists.php.net to get a copy of this message
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)

« previous php.template (#244) next »