[UPHPU] Template engines

Mac Newbold mac at macnewbold.com
Wed Oct 4 16:30:23 MDT 2006


Today at 4:11pm, Walt Haas said:

> I'd be interested to hear from any graphic artists out there what they
> see as the pros and cons of template engines in general, and Smarty in
> particular.  Are these templates easier for an artist to work with
> than the equivalent PHP code?
> 
> I already know the engineering pros and cons, so don't need comments
> about that aspect of it.

I'll preface this with the fact that I'm not a graphic artist. But I've worked 
with many of them.

The bottom line: most graphic designers/artists don't know HTML and don't want 
to learn it. If they do any of it, it's with a WYSIWIG and isn't worth using 
with a PHP app. So a template language won't change the fact that they wouldn't 
be able to manage the HTML themselves anyway.

What I've seen of Smarty indicates to me that it really isn't all that much 
simpler in syntax than PHP, and is a lot more limited, so even if you had some 
designer working on the HTML, it's probably just as easy for them to use the 
equivalent PHP directly as to use Smarty, as long as you separate out the files 
appropriately. (Variable interpolation, foreach loops, etc, are practically 
equivalent in Smarty and PHP, the Smarty just makes you use a different 
syntax.)

Whether or not you go with smarty, or something else, or just straight PHP, I'd 
still make sure to separate out the look and feel stuff from the application 
logic if they're going to be worked on by different people or different groups. 
There will always be some interdependencies between them, even with Smarty, but 
the more you can limit them, the more flexibility each side will have without 
help from the other side.

Again, I'm not a designer, so take it with a grain of salt, or a block of salt 
if you want, but I can't remember a single time in the last 5 years where we've 
had a designer that wanted to do the HTML while we did the PHP/MySQL stuff, 
even though Wade was one of the designers we worked with.

Mac

--
Mac Newbold			Code Greene, LLC
 				1440 S. Foothill Dr. Suite #250
Office:	801-438-0142		Salt Lake City, UT  84108
Cell:	801-694-6334		www.codegreene.com


More information about the UPHPU mailing list