Smarty – PHP Template Engine

By batman

Smarty Template Engine

Smarty is one of the most popular and widely used php template engines and the number one template engine on my list. It is very flexible and easy to get hooked on. You can even execute php code inside the template, a feature that other template engines do not have. Working with Smarty will not be always trouble-free for beginners but don’t you worry, the Smarty template engine website has all the documentation and programmer’s API that you need.

As of this writing, the latest stable released is 2.6.18. This version fixed the bug on the detection of non-cached blocks in version 2.6.17. If you are still using version 2.6.17, it is recommended that you upgrade to the latest stable release.

For starters, you have to be very careful when putting Javascript codes or CSS in your template and be sure to enclose them with literal tags. Below is a sample code:

{literal}

your CSS or Javascript codes here.

{/literal}

Smarty will ignore lines enclosed with literal tags as Smarty will always parse and execute lines that use curly braces. If you are itching to start using Smarty now, then hop onto Smarty website. Don’t forget to read documentations, FAQs and manuals.

Related Article(s):

Using Smarty Template Engine with Xajax Toolkit

Share/Save/Bookmark

Tags: , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

*