3 ms·
I. HATE. PHP. TEMPLATING. ENGINES. Back when php was relatively new (2002 - 2003), our company hired a few php developers to build several ecommerce solutions.
by citizenkeys 16y ago
I. HATE. PHP. TEMPLATING. ENGINES.
Back when php was relatively new (2002 - 2003), our company hired a few php developers to build several ecommerce solutions. They swore up and down at the time that smarty and pear would get the job done faster and better.
Long story short, after implementing the solution rather quickly we spent more money deleting giant gobs of lame templating code and re-writing the rest of code in very lean php than we did on the original project.
Never again will I use any templating engine on top of a scripting language. It's actually a written core requirement for any new project I contract ("no lame templating engines").
Templating junk can also make it more difficult to get lean standards-compliant html that you need for reliable javascript behavior.
Don't use templating to junk up your code. You've been warned.
- pornel 16y agoThere are lots of "find'n'replace" template engines which really suck. But have a look at http://PHPTAL.org http://PHPTAL.org — its attribute-only syntax not only preserves structure of HTML well, but PHPTAL actually parses XHTML and enforces its well-formedness (i.e. you can't produce HTML with misnested or unclosed tags).
- toolate 16y agoI've found that the quality of a PHP project tends to be fairly independant of whether it uses a templating library. One benefit of Smarty is that it forces at least some seperation of business and display logic. People will still try and shove business logic into the templates, but at least you know you're not going to find SQL statements halfway though the rendering of a table.