Smarty : Introduction

Smarty is a web template system written in PHP. Smarty is primarily promoted as a tool for separation of concerns, which is a common design strategy for certain kinds of applications.

Smarty generates web content by the placement of special Smarty tags within a document. These tags are processed and substituted with other code.

Tags are directives for Smarty that are enclosed by template delimiters. These directives can be variables, denoted by a dollar sign ($), functions, logical or loop statements. Smarty allows PHP programmers to define custom functions that can be accessed using Smarty tags.

Smarty is intended to simplify compartmentalization, allowing the presentation of a web page to change separately from the back-end. Ideally, this eases the costs and efforts associated with software maintenance. Under successful application of this development strategy, designers are shielded from the back-end coding, and PHP programmers are shielded from the presentation coding.

Smarty supports several high-level template programming features, including:

  • Control flow statements, foreach
  • if, elseif, else statements
  • variable modifiers – For example {$variable|nl2br}
  • functions – For example {html_select_date start_year=’-5′ end_year=’+5′}
  • output filters
  • possiblity to create own modifiers / functions / output filters
  • advanced caching of pages

along with other features. There are other template engines that also support these features. Smarty templates are often incorporated into existing PHP web applications to some extent. More often it is used where a web application or a website has a theme system built into it, where the templates can be changed from theme to theme.

The latest verision of the Smarty can download from the below URL,

http://www.smarty.net/download.php

 

Smarty

Smarty

Know More about Smarty by detail follow the link,

http://www.smarty.net/manual/en/

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: