Re: [PHP Template] Section hiding and includes

[email protected] (Dan Libby) Mon, 13 Mar 2000 16:40:00 -0800
Newsgroups php.template
Message-ID <[email protected]>
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: [email protected]