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

From: Date: Tue, 21 Mar 2000 19:23:03 +0000
Subject: Re: [PHP3] Re: [PHP Template] Re: [PHP3] PHP Template Engine spec revision 0.52
References: 1  Groups: php.template 
Request: Send a blank email to php-template+get-368@lists.php.net to get a copy of this message
> 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. I tend to agree with Zeev here... I see no purpose for templates if they go byeond this: <HTML> <HEAD><TITLE>{TITLE}</TITLE></HEAD> <BODY><TABLE> <!-- block --> <TR> <TD>{CONTENT}</TD> <TD>{CONTENT_TWO}</TD> </TR> <!-- block --> </TABLE> </BODY> </HTML> ... I'll be the first one to admit that I would *really* like at times to have a <?php if($this): ?> statement in my template... it'd be great.... but I can acccomplish the same thing like this... take, for example... if I want to include a piece of javascript or not based on the $HTTP_USER_AGENT variable. // {CONTENT} represents a link (pseudo-code) $link = "<A HREF='".$URL."'"; if($browserver >= 4) $link .= " onMouseover='dojavascript();' "; $link .= ">".$LINKNAME."</A>"; SetVar("CONTENT", $link); Volia... I've included HTML (err.. javascript) code based on a conditional... My point is this... although it might not be as absolutely cut-and-dry to use {CONTENT} instead of <A HREF="{URL}" {IF @BROWSERVER >=4}onMouseOver='dojavascript();'</IF>>{LINKNAME}</A> you actually have a LOT more realibility with the former... besides.... not only do I *NOT* want to learn another lanaguge if I want templates... I wouldn't trust the lanaguage to function as expected... my sites need to work, a PHP3 has earned my trust as-is. John

« previous php.template (#368) next »