Re: [PHP Template] Section hiding and includes

From: Date: Tue, 14 Mar 2000 00:40:00 +0000
Subject: Re: [PHP Template] Section hiding and includes
References: 1  Groups: php.template 
Request: Send a blank email to php-template+get-312@lists.php.net to get a copy of this message
So, this only applies if template2 is completely empty, correct? Otherwise it would have *some* content, and the returned value would not be empty. I think what you are really asking though is whether sections and variables in template2 should have meaning to template1, or if the returned value is a simple string. I think that the latter provides 90% of desired functionality and is easier to implement. Basically this comes down to parsing each file as it is included or wait until all files have been included and then parse the whole thing. I think the former is preferable, esp since includes could be within if statements. -dan Andrei Zmievski wrote: > Here's a situation: > > template1.tpl has: > > { section sec1 hideonsections=any } > ... > { include template2.tpl } > ... > { /section } > > template2.tpl has: > > { section sec2 hideonvars=any } > ... > @var1 > ... > { /section } > > Let's say @var1 has no values. This means that 'sec2' gets hidden > automatically. Now, my question is, should 'sec1' be hidden as well > since itis set to hide if any child section is hidden? I guess it > depends on how you look at it. I can't really come up with a situation > where it'd be useful to depend on the sections you're including inside > another section via { include ... }. What do you think? > > -Andrei > * Use the source, Luke. * > > -- > PHP Template Engine Mailing List > Current engine specification can be found at: > http://va.php.net/~andrei/tpl-engine-spec.txt > To unsubscribe, e-mail: php-template-unsubscribe@lists.php.net

« previous php.template (#312) next »