BKWLD

 

Smarty

By Robert on November 27, 2007 at 9:13 am

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:

Anyway, it’s a cool system.

No Comments »

No comments yet.


RSS feed for comments on this post. | TrackBack URI

Leave a comment