by rickmb · 13y ago · 0 comments
We're using smarty at work now, and while we probably won't drop it in this project (too much working code written in it), we might learn something for the future.
Otherwise PHP itself is a template language. That is why you start it with <? tag.
Just keep short tags on [it's off by default on new installations but ON by default on all hosting sites] and you got a better template engine than smarty.
My guess is that whoever wrote the framework just heard about Smarty while in university, long time ago.
I believe Twig is a fast and secure PHP template language.
I'm used to Jinja2 in Python which is almost identical to Twig.
Has anyone used Twig who would share their experience?
Really, PHP itself is a fine templating language if used properly. Get to know the short tags (including the short echo <?=$stuff?>) and the alternative syntax for conditional statements and you are good to go.