» 
Arabic Bulgarian Chinese Croatian Czech Danish Dutch English Estonian Finnish French German Greek Hebrew Hindi Hungarian Icelandic Indonesian Italian Japanese Korean Latvian Lithuanian Malagasy Norwegian Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swedish Thai Turkish Vietnamese
Arabic Bulgarian Chinese Croatian Czech Danish Dutch English Estonian Finnish French German Greek Hebrew Hindi Hungarian Icelandic Indonesian Italian Japanese Korean Latvian Lithuanian Malagasy Norwegian Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swedish Thai Turkish Vietnamese

definition - Smarty

definition of Wikipedia

   Advertizing ▼

phrases

Wikipedia

Smarty

                   
Smarty
Smarty-logo.png
Developer(s) Monte Ohrt, Messju Mohr
Stable release 3.1.8 / 20 February 2012; 4 months ago (2012-02-20)
Written in PHP
Type Template Engine
License LGPL
Website www.smarty.net

Smarty is a web template system written in PHP. Smarty is primarily promoted as a tool for separation of concerns.[1] 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.

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.

Contents

  Features

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

  • 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
  • possibility to create own modifiers / functions / output filters
  • advanced caching of pages.
  • possibility to execute output filters.

along with other features. There are other template engines and frameworks that also support these features. Smarty templates can be incorporated into existing PHP web applications. 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.

  Criticism

Smarty has been criticized for replicating features that PHP does natively very well, which leads to inefficiency.[3] Not only does Smarty require learning a new pseudo-language, it creates additional work for the processor. It is also seen as a poor replacement for full PHP frameworks, which have the benefits of Smarty in terms of templating, plus other benefits. Despite Smarty's flaws, including bugs and its superfluous nature within PHP frameworks, some developers still use it in conjunction with frameworks.

  Smarty example

Since Smarty separates PHP from HTML, there are two files — one contains the presentation code: an HTML template, including Smarty variables and tags which might look like this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html>
<head>
   <title>{$title_text|escape}</title>
   <meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
 
<body> {* This is a little comment that won't be visible in the HTML source *}
 
{$body_html}
 
</body><!-- this is a little comment that will be seen in the HTML source -->
</html>

The business logic to use the Smarty template above could be as follows:

define('SMARTY_DIR', 'smarty-2.6.22/' );
require_once(SMARTY_DIR . 'Smarty.class.php');
 
$smarty = new Smarty();
$smarty->template_dir = './templates/';
$smarty->compile_dir = './templates/compile/';
 
$smarty->assign('title_text', 'TITLE: This is the Smarty basic example ...');
$smarty->assign('body_html', '<p>BODY: This is the message set using assign()</p>');
 
$smarty->display('index.tpl');

  Further reading

  References

  1. ^ Parr, Terence John (2004). Enforcing strict model-view separation in template engines. Proceedings of the 13th international conference on World Wide Web. ISBN 1-58113-844-X. 
  2. ^ Is Smarty right for me?
  3. ^ Why Template Systems Like Smarty Are Useless and Sometimes Bad

  See also

  External links

   
               

   Advertizing ▼

 

All translations of Smarty


sensagent's content

  • definitions
  • synonyms
  • antonyms
  • encyclopedia

Dictionary and translator for handheld

⇨ New : sensagent is now available on your handheld

   Advertising ▼

sensagent's office

Shortkey or widget. Free.

Windows Shortkey: sensagent. Free.

Vista Widget : sensagent. Free.

Webmaster Solution

Alexandria

A windows (pop-into) of information (full-content of Sensagent) triggered by double-clicking any word on your webpage. Give contextual explanation and translation from your sites !

Try here  or   get the code

SensagentBox

With a SensagentBox, visitors to your site can access reliable information on over 5 million pages provided by Sensagent.com. Choose the design that fits your site.

Business solution

Improve your site content

Add new content to your site from Sensagent by XML.

Crawl products or adds

Get XML access to reach the best products.

Index images and define metadata

Get XML access to fix the meaning of your metadata.


Please, email us to describe your idea.

WordGame

The English word games are:
○   Anagrams
○   Wildcard, crossword
○   Lettris
○   Boggle.

Lettris

Lettris is a curious tetris-clone game where all the bricks have the same square shape but different content. Each square carries a letter. To make squares disappear and save space for other squares you have to assemble English words (left, right, up, down) from the falling squares.

boggle

Boggle gives you 3 minutes to find as many words (3 letters or more) as you can in a grid of 16 letters. You can also try the grid of 16 letters. Letters must be adjacent and longer words score better. See if you can get into the grid Hall of Fame !

English dictionary
Main references

Most English definitions are provided by WordNet .
English thesaurus is mainly derived from The Integral Dictionary (TID).
English Encyclopedia is licensed by Wikipedia (GNU).

Copyrights

The wordgames anagrams, crossword, Lettris and Boggle are provided by Memodata.
The web service Alexandria is granted from Memodata for the Ebay search.
The SensagentBox are offered by sensAgent.

Translation

Change the target language to find translations.
Tips: browse the semantic fields (see From ideas to words) in two languages to learn more.

last searches on the dictionary :

2791 online visitors

computed in 0.062s

I would like to report:
section :
a spelling or a grammatical mistake
an offensive content(racist, pornographic, injurious, etc.)
a copyright violation
an error
a missing statement
other
please precise:

Advertize

Partnership

Company informations

My account

login

registration

   Advertising ▼