There has been a lot of talk about how Smarty, a popular template engine for PHP, is bloated and not useful because PHP is already a templating engine and that you’re essentially creating a template engine out of a template engine. As everything I read could just say that it was bloated without backing up their statement, I decided to investigate it myself and see why it’s just like your regular PHP template engine.

Here’s a short snippet of the article.

The popular argument against Smarty is that PHP is already a template engine, so why not just write template files in PHP using the PHP syntax? But, with Smarty, you are effectively doing this; you just don’t know it. When you do $smarty->display('template.tpl'); you are causing the Smarty engine to lookup template.tpl in it’s compiled cache and run that code. Check out your compiled directory in Smarty’ll look like bad formatted PHP code, but that’s because a human is never intended to read it. The important thing is that it’s PHP and that’s what Smarty is executing.

Drop by, give us a read and if you like, share with us your Smarty tricks.