Thread: Template Engine
View Single Post
Old 02-26-2009, 02:13 AM   #6 (permalink)
allworknoplay
The Gregarious
 
allworknoplay's Avatar
 
Join Date: Feb 2009
Location: New York
Posts: 645
Thanks: 64
allworknoplay is on a distinguished road
Default

Quote:
Originally Posted by Wildhoney View Post
The gripe I have with Smarty and other such template engines is precisely what has been mentioned! Why should we learn another seemingly differently language? Why are they creating yet another language for us to use when we have so many already at our disposal?

In my personal opinion, PHP is most certainly more than capable of handling this type of thing. However, I use the other syntax for the conditionals. Which is the following:

Code:
<?php if ($myVariable): ?>
<b>My variable has been set!</b>
<?php endif; ?>
For certain things, such as alternate row colours, I have created myself a class called a Zebra class. I am not sure where I got that name from, it must be my over-active imagination once again! And simply call it like below. You are even able to specify conditionals for a different row colour.

html4strict Code:
<div class="<?php echo TalkPHP_Zebra::getNext(); ?>">TalkPHP loves you.</div>

I don't see why people choose to use Smarty? Perhaps somebody could explain this to me.

Yeah like I said, I have enough on my plate...so I would have to learn another language to work with PHP, a language of itself?

that's like speaking to an interpreter only for him/her to interpret yet again!!

Zebra!! I love that name!!! I think I am going to steal it.

This is what I use for changing TR colors...

$row[color] ? "#e0e0e0" : "#EEEEEE";
allworknoplay is offline  
Reply With Quote