Smarty
I had started out building a new php project to have blocks of html code within class files that would do find and replace on the html, adding dynamic code where I had written special tags. Essentially, I had templates and PHP logic that powered them. In the course of researching something for this, I came across Smarty Templates. I’ve switched over to using this system to power the interaction between templates and logic on this project and I think I’ll be using it more in the future. It’s pretty dope. Fundamentally it defines special tags you instert into html and has a special class with methods designed to populate these tags. Here’s a little overview of some of the reasons I’ve decided to use them:
Reasons for Smarty:
- Compiling of templates so that str_replace lag is removed (read: speed)
- Caching of pages. This would be a way to reduce the amount of queries that are run (read: speed)
- Full seperation between logic and code. The logic could be only in the engine while the templates follow the master, theme, client route.
- Should allow custom templates to be a lot easier to make for noobs and may actually encourage more customization
- Was created in like 2002 and continues to be updated even in the last week
- Works in conjunction with popular php accelerators
- Developed in part by php team
Some links I was looking at while researching it:
- http://smarty.php.net
- http://www.onlamp.com/pub/a/php/2002/09/05/smarty.html
- http://www.sitepoint.com/article/smarty-php-template-engine
Anyway, it’s a cool system.

