It is efficient since the PHP parser does the dirty work.
You can easily create your own custom functions and variable modifiers, so the template language is extremely extensible.
The if elseif constructs are passed to the PHP parser, so the if expression syntax can be as simple or as complex an evaluation as you like.
Allows unlimited nesting of sections, if’s etc.
It is possible to embed PHP code right in your template files, although this may not be needed (nor recommended) since the engine is so customizable.
Built-in caching support. (wow. No more low resources server burden).
Smarty requires a web server running PHP 4.0.6 or greater.
Following folders are essential in a smarty based website. templates has tpl files and templates_c stores cached pages (It is website cache). Smarty contains lib folder containing smarty software. Name of these default folders can be changed and it is recommended to change these and tell script accordingly templates directory and cache directory and location of Smarty.class.php.
Images and css folders you will have to create, as every website has these. With these you can create a configs folder to store configuration files.
After you have created above mentioned structure, the concept is to create PHP pages and place those in root and in templates folder create tpl files for these pages. There will be index.php file containing PHP code and variables at root directory of website and there will be index.tpl file in templates folder containing html code, design part of website and smarty code. We send PHP variables from index.php to index.tpl smarty code and then it mix things together in simple words and compile the page for you and build its cache too.
Above we are sending variable from PHP to smarty for navigational element HOME. In tpl file we will write some smarty code which will apply class selected to that element.
Above we included header, body and footer code in single index page.
Download smarty based website. Just upload it at your PHP enabled server or copy files to WAMP local server and browse index.php to see smarty in action.