Re: [PHP Template] Section hiding and includes

[email protected] (Andrei Zmievski) Mon, 13 Mar 2000 21:58:27 -0600
Newsgroups php.template
Message-ID <[email protected]>
At 04:40 PM 3/13/00 -0800, Dan Libby wrote:
>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.

I was thinking that the only variables that would affect automatic section
collapsing would be @ (loop variables). Having section depend on # or $
variables just wouldn't make much sense.

But you're right, the essence is whether the included template gets treated
as the string result of parsing or as an actual compiled entity. I know
it'd be easier to make it work as a string result, but then you couldn't
really cache it and it'd have to be reparsed each time you happened upon it.

I guess for now I'll make it so that template2 sections don't influence
template1 sections, and we'll see what happens. I'm not going to be too
rigid about it, we can always rework the engine.

-Andrei