Smarty

What is SMARTY :

Smarty is the template engine for the PHP. It gives the managable way to separate application logic & contents from presentation logic. Because of smarty designer can concentrate on designing & programmer can concentrate on programming & both doesnot interfare to each other task. Suppose designer wants to display some value from database on html page. Normally designer is not aware about database so that programmer just pass required value to the designer because of this designer easily get what he wants.
Smarty makes the code cleaner as well as easy to debug & update in future. Designer who deal with html file can handle the smarty templates.

How to install smarty on wamp :
I am going to tell you easiest  way to install smarty as follows

- Insert the folder Smarty-2.6.26 in the path C:\wamp\bin\php\php5.2.5.
- Search for include_path in PHP configuration file insert the following path
- C:\wamp\bin\php\php5.2.5.\Smarty-2.6.26\libs below the windows.
- Create four folder in C;\wamp who's name sholud be templates, templates_c, cache, configs.
- Create a php file & tpl file save on root folder & run php file via wamp.
- enjoy Smarty.................

 - Smarty comments
{* This is single line comment *}
{* This is
    multiline comment.
   Ok.
* }

Variable Modifier :
There are many variable modifiers available such as
capitalize, cat, lower, upper, escape, default, count_sentences, count_paragraphs, count_words, count_characters, truncate, wordwrap,

Build-In Functions :
some important functions are as follows
{literal}      - Used to add javascript & css code in template.
{foreach}   - To access array values.
{include}    - To include other templates .
{section}    - Same as foreach but very effective.
{php}        - To add PHP code in template.
{include_php} - To add external php code.
{if}{elseif}  - If-Else condition

Custom Function :
These function are very user friendly, These fuction reduce our tension in coding.
Some of the functions are as follows
html_radios, html_checkboxes, html_options, html_table, html_select_date, html_select_time, mailto, math.


Methods :