Hacker News new | ask | show | jobs
by Osiris 5014 days ago
I work on a legacy code base with pretty much everything in SMARTY templates (including CSS and JS files!) and it's really aweful. It may not be SMARTY's fault, but most of what's going on could be just as easily done with PHP code than with SMARTY tags, include variable insertion (<?=$var?>) and control logic (if ($var) : // endif;).

Now we've actually moved everything to the client side using Ember and Handlebars templates. JS doesn't have any built-in templating like PHP (which is basically just a template engine), so Handlebars makes it really useful to write up HTML code blocks that get variable insertion and data-binding on the client side.

1 comments

  > include variable insertion (<?=$var?>)
No disable your short tags and any nontrivial template will become ugly as hell, unless you are on php 5.4+ which not many are.