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
HTML Template Engines
Re:HTML Template Engines
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.
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
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
- Nick