Smarty is a template language created in 2006 by Monte Ohrt and Messju Mohr and Uwe Tews.
#446on PLDB | 17Years Old | 586Users |
4Books | 0Papers | 31kRepos |
Smarty is a web template system written in PHP. Smarty is primarily promoted as a tool for separation of concerns. Smarty is intended to simplify compartmentalization, allowing the front-end of a web page to change separately from its back-end. Read more on Wikipedia...
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>{$title_text|escape}</title>
</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>
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');
title | authors | year | publisher |
---|---|---|---|
Smarty PHP Template Programming And Applications | Hasin Hayder and J. P. Maia and Lucian Gheorghe | 2006 | Packt Publishing |
Smarty PHP Template Programming and Applications | Hasin Hayder and Joao Prado Maia and Lucian Gheorghe | 2006-04-30 | Packt Publishing |
PHP and Smarty on Large-Scale Web Development | Bruno Pedro | 20070619 | O'Reilly Media, Inc. |
Smarty: PHP template programming and applications : a step-by-step guide to building PHP web sites and applications using the Smarty templating engine | Prado Maia, Jo茫o. | 2006 | Packt Pub. |