Play Video
1
Smarty en concert au New Morning - L
Smarty en concert au New Morning - L'INTEGRALE
::2014/04/08::
Play Video
2
Smarty - Au royaume de mes espérances (clip officiel)
Smarty - Au royaume de mes espérances (clip officiel)
::2014/03/17::
Play Video
3
SMARTY - Afrikan Kouleur - Le chapeau du chef
SMARTY - Afrikan Kouleur - Le chapeau du chef
::2012/10/27::
Play Video
4
Smarty
Smarty's Untitled Review Show - Destiny Beta
::2014/07/30::
Play Video
5
SMARTY Stop pas la musique OFFICIEL
SMARTY Stop pas la musique OFFICIEL
::2012/11/19::
Play Video
6
Smarty parle à ses fans
Smarty parle à ses fans
::2011/08/02::
Play Video
7
Введение в шаблонизатор Smarty
Введение в шаблонизатор Smarty
::2012/02/12::
Play Video
8
SMARTY MUSIC - ELECTRO TECHNO - BOOTY BABES
SMARTY MUSIC - ELECTRO TECHNO - BOOTY BABES
::2011/02/04::
Play Video
9
Smarty - Au royaume de mes espérances (nouvelle version)
Smarty - Au royaume de mes espérances (nouvelle version)
::2013/12/15::
Play Video
10
Garry
Garry's Mod Murder! | TURTLES! (75) W/ Minx, Chilled, Smarty & Galm
::2014/07/29::
Play Video
11
PHP Smarty Template Engine Tutorial - Part 1 - PHP Training Tutorial
PHP Smarty Template Engine Tutorial - Part 1 - PHP Training Tutorial
::2014/03/25::
Play Video
12
SMARTY MUSIC & DJ ASSAD FT. CRAIG DAVID - ADDICTED!
SMARTY MUSIC & DJ ASSAD FT. CRAIG DAVID - ADDICTED!
::2012/08/28::
Play Video
13
Lana del Rey - Smarty ( Lyrics )
Lana del Rey - Smarty ( Lyrics )
::2012/03/05::
Play Video
14
Smarty Ring
Smarty Ring
::2013/11/11::
Play Video
15
Smarty Rage Quits! (Mario Kart 8 Online: The Derp Crew - Part 34)
Smarty Rage Quits! (Mario Kart 8 Online: The Derp Crew - Part 34)
::2014/07/03::
Play Video
16
SMARTY MUSIC - ELECTRO HOUSE - WORLD TOUR
SMARTY MUSIC - ELECTRO HOUSE - WORLD TOUR
::2011/08/22::
Play Video
17
Observing! With Style! (Trouble in Terrorist Town)
Observing! With Style! (Trouble in Terrorist Town)
::2014/07/30::
Play Video
18
Arcade Shenanigans! (Chilled, Smarty, and Kara)
Arcade Shenanigans! (Chilled, Smarty, and Kara)
::2013/08/25::
Play Video
19
SMARTY MUSIC - ELECTRO HOUSE - WET REPUBLIC
SMARTY MUSIC - ELECTRO HOUSE - WET REPUBLIC
::2011/04/30::
Play Video
20
74b The Return of Super Smarty Pants
74b The Return of Super Smarty Pants
::2013/05/03::
Play Video
21
SMARTY MUSIC - ELECTRO HIP HOP - THE RUSH
SMARTY MUSIC - ELECTRO HIP HOP - THE RUSH
::2012/02/18::
Play Video
22
Lana Del Rey - Smarty Lyrics
Lana Del Rey - Smarty Lyrics
::2013/11/03::
Play Video
23
PHP Smarty Template Engine Tutorial
PHP Smarty Template Engine Tutorial
::2010/09/08::
Play Video
24
SMARTY MUSIC - ELECTRO HOUSE 2014 - END OF THE YEAR
SMARTY MUSIC - ELECTRO HOUSE 2014 - END OF THE YEAR
::2013/12/27::
Play Video
25
SMARTY MUSIC- ELECTRO DUB SESSION 2013 - THIS IS MUSIC
SMARTY MUSIC- ELECTRO DUB SESSION 2013 - THIS IS MUSIC
::2013/03/31::
Play Video
26
Tutorial PHP: Smarty - Motor de plantillas
Tutorial PHP: Smarty - Motor de plantillas
::2013/02/10::
Play Video
27
Poor, Poor Smarty (Mario Kart 8 Online: The Derp Crew - Part 48)
Poor, Poor Smarty (Mario Kart 8 Online: The Derp Crew - Part 48)
::2014/07/17::
Play Video
28
SMARTY MUSIC - ELECTRO HOUSE - ITS LIKE THAT
SMARTY MUSIC - ELECTRO HOUSE - ITS LIKE THAT
::2011/12/02::
Play Video
29
Cruze | Smarty Ajjee |  Full Song HD | Japas Music
Cruze | Smarty Ajjee | Full Song HD | Japas Music
::2014/03/27::
Play Video
30
SMARTY MUSIC - ELECTRO SUMMER 2013 - WET REPUBLIC
SMARTY MUSIC - ELECTRO SUMMER 2013 - WET REPUBLIC
::2012/02/29::
Play Video
31
SMARTY MUSIC - DUBSTEP DRUM AND BASS - SILLY GIRL
SMARTY MUSIC - DUBSTEP DRUM AND BASS - SILLY GIRL
::2012/01/18::
Play Video
32
SMARTY MUSIC FEAT DJ BL3ND - ELECTRO HOUSE - GO AGAIN
SMARTY MUSIC FEAT DJ BL3ND - ELECTRO HOUSE - GO AGAIN
::2011/03/23::
Play Video
33
Smarty Tuner In A Common Rail Cummins
Smarty Tuner In A Common Rail Cummins
::2011/10/21::
Play Video
34
I
I'm a Smarty and I Know it
::2012/03/02::
Play Video
35
SMARTY MUSIC 2013 WET REPUBLIC HQ
SMARTY MUSIC 2013 WET REPUBLIC HQ
::2014/01/25::
Play Video
36
Wimpy Hot Sauce Challenge (Chilled and Smarty - Otakon 2013)
Wimpy Hot Sauce Challenge (Chilled and Smarty - Otakon 2013)
::2013/08/18::
Play Video
37
SMARTY MUSIC & LMFAO - ELECTRO HIP HOP - PARTY LIGHTS
SMARTY MUSIC & LMFAO - ELECTRO HIP HOP - PARTY LIGHTS
::2011/09/02::
Play Video
38
SMARTY MUSIC - ELECTRO POP - GET LOUD
SMARTY MUSIC - ELECTRO POP - GET LOUD
::2012/08/20::
Play Video
39
Lana Del Rey - Smarty ~lyrics~
Lana Del Rey - Smarty ~lyrics~
::2012/05/24::
Play Video
40
SMARTY MUSIC - ELECTRO HOUSE - SHAKE THAT ASS
SMARTY MUSIC - ELECTRO HOUSE - SHAKE THAT ASS
::2010/01/30::
Play Video
41
Smarty desde cero
Smarty desde cero
::2009/03/05::
Play Video
42
Cummins Smarty Smoke Level 9
Cummins Smarty Smoke Level 9
::2012/11/15::
Play Video
43
Smarty Pants dance
Smarty Pants dance
::2009/02/01::
Play Video
44
SMARTY MUSIC - ELECTRO TECHNO - ARE U READY
SMARTY MUSIC - ELECTRO TECHNO - ARE U READY
::2010/08/06::
Play Video
45
2004 Preakness Stakes - Smarty Jones : Full Broadcast
2004 Preakness Stakes - Smarty Jones : Full Broadcast
::2013/04/21::
Play Video
46
Let
Let's Play: "Smarty Lab Galaxy"
::2013/08/28::
Play Video
47
JTest - Johnny
JTest - Johnny's Super Smarty Pants
::2012/01/15::
Play Video
48
Between the Lions: "Dance in Smarty Pants"
Between the Lions: "Dance in Smarty Pants"
::2008/05/17::
Play Video
49
Garry
Garry's Mod Murder! | THE BATMAN! (73) W/ Minx, Chilled, Smarty & Galm
::2014/07/25::
Play Video
50
Smarty Update with UDC!
Smarty Update with UDC!
::2012/11/23::
NEXT >>
RESULTS [51 .. 101]
From Wikipedia, the free encyclopedia
Jump to: navigation, search
For the Nestlé confectionery, see Smarties. For other similarly named items, see Smarties (disambiguation).
Smarty
Smarty-logo.png
Developer(s) Monte Ohrt, Messju Mohr
Stable release 3.1.18 / 7 April 2014; 3 months ago (2014-04-07)
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 front-end of a web page to change separately from its back-end. Ideally, this lowers costs and minimizes the efforts associated with software maintenance.

Smarty generates web content through 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 example[edit]

Since Smarty separates PHP from HTML, there are two files — one contains the presentation code: an HTML template, including Smarty variables and tags - {$title_text|escape} {$body_html} - 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[edit]

  • Hasin Hayder, J. P. Maia, Lucian Gheorghe (2006). Smarty PHP Template Programming And Applications. ISBN 978-1-904-81140-4. 

References[edit]

  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. 

See also[edit]

External links[edit]

Wikipedia content is licensed under the GFDL License
Powered by YouTube
LEGAL
  • Mashpedia © 2014