Re: [PHP3] Re: [PHP Template] Re: [PHP3] PHP Template Engine spec revision 0.52

From: Date: Tue, 21 Mar 2000 18:00:32 +0000
Subject: Re: [PHP3] Re: [PHP Template] Re: [PHP3] PHP Template Engine spec revision 0.52
References: 1 2  Groups: php.template 
Request: Send a blank email to php-template+get-349@lists.php.net to get a copy of this message
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. *

« previous php.template (#349) next »