Page 1 of 1

HTML Template Engines

Posted: Thu Jan 09, 2003 7:24 pm
by sonneveld
Heya,

Currently working on updating my site (last news update was July last year!). I'm making sure the news, games, downloads and links are up to date.

I'm interested in templates at the moment however. Previous PHP efforts have had the php and html code mixed up together but I want to convert my code to use a template engine of some sort.

I have PHP and mySQL access on my webserver.. and if I whinge I *might* be able to get perl and python.

Does anybody have any experience with a decent template engine for php? Here's some engines I've played around with (or researched):

smarty:
cons: very convoluted.. requires C for cache
http://smarty.php.net/

phpLib:
pros: works alright
cons: have to undefine vars all the bloody time.
cons: can't have blocks on one line
cons: have to predefine dynamic blocks in php code
http://ontosys.com/php/templates.html
http://phplib.sourceforge.net/
http://www.sanisoft.com/phplib/

fastTemplate:
cons: uses separate files
http://www.phpbuilder.com/columns/sascha19990316.php3

templatePower:
pro: nested
con: have to predefine dynamic blocks
http://templatepower.codocad.com

ultratemplate:
pro: nested
cons: very wordy syntax
http://www.ultratemplate.com

- Nick

Re:HTML Template Engines

Posted: Fri Jan 10, 2003 6:44 am
by AGI1122
Well I built my own template system when I made my message board. What I like to do is store the html in an html table in a database this is much faster than having to load and save flatfiles all the time.

Anyway my best suggestion is to build your own, that way it will work perfectly for what you need and want.

Re:HTML Template Engines

Posted: Fri Jan 10, 2003 6:30 pm
by sonneveld
If you're reading from flatfiles won't it be cached anyway? I'm trying to use standard libraries to get this done quicker anyway :)

- Nick