Re: [PHP3] Re: [PHP Template] Re: [PHP3] PHP Template Engine spec revision 0.52
[email protected] (Andrei Zmievski) Tue, 21 Mar 2000 12:00:32 -0600
| Newsgroups | php.template |
|---|---|
| Message-ID | <[email protected]> |
On Tue, 21 Mar 2000, Zeev Suraski wrote:
> If it can be sophisticated, it means that people who want to read it would
> have to be familiar with this spec, thoroughly, even if they're already
> quite fluent in PHP. That's the bad thing. Having the ability to decide
> whether it's simple or complicated is not a plus, it should be simple by
> definition.
Being fluent in more than one language is not a bad idea, I think. Don't
limit your options.
> I am providing a solution - you provided it yourself in your example, that
> compared how to implement the template if in PHP code. Use PHP syntax for
> logic, use your templates for presentation. I won't suggest using 'for'
> loops instead of 'while' loops, which you may consider as constructive
> criticism. I suggest moving logic outside of the templates engine
> altogether.
'if' was an easy example. Compare this:
{section}
Headline: {@headline}
{if #LAST}
<hr>
{/if}
{/section}
with this:
<? for ($i=0; $i<count($headlines); $i++): ?>
Headline: <? echo $headlines[$i]; ?>
<? if ($i == count($headlines)-1): ?>
<hr>
<? endif; ?>
<? endfor; ?>
No contest for me.
-Andrei
* Power corrupts. Atomic power corrupts atomically. *