|
Smarty is a template engine written in PHP. Smarty separates PHP, as a business logic, from HTML, a presentation logic, and generates web content by the placement of special Smarty tags within a document (i.e. variable substitution). Image File history File links Smarty-logo. ...
In software engineering, software maintenance is the process of enhancing and optimizing deployed software (software release), as well as remedying defects. ...
A software release refers to the creation and availability of a new version of a computer software product. ...
A software license is a legal agreement which may take the form of a proprietary or gratuitous license as well as a memorandum of contract between a producer and a user of computer software. ...
GNU logo The GNU Lesser General Public License (formerly the GNU Library General Public License) is an FSF approved Free Software license designed as a compromise between the GNU General Public License and simple permissive licenses such as the BSD license and the MIT License. ...
Website - Wikipedia, the free encyclopedia /**/ @import /skins-1. ...
The server-side web template in the web page process, to produce dynamic web pages with the template engine. ...
PHP is an open-source, reflective programming language. ...
PHP is an open-source, reflective programming language. ...
Business logic refers to the logic that embodies business rules rather than the view of data or storage, with the consumers of the business process. ...
An excerpt of HTML code with syntax highlighting In computing, HyperText Markup Language (HTML) is a markup language designed for the creation of web pages with hypertext and other information to be displayed in a web browser. ...
Tags are variables such as {$variable}, and a range of logical and loop operators. In logical calculus, logical operators or logical connectors serve to connect statements into more complicated compound statements. ...
In computer science control flow (or alternatively, flow of control) refers to the order in which the individual statements or instructions of an imperative program are performed or executed. ...
This makes for much cleaner coding and more flexible modification. For instance, one could typically modify a Smarty-based application's appearance (i.e. skin) easily, without ever looking at any business logic or PHP code. This compartmentalization also allows for the the back-end to change separate from the layout. Most intracellular organelles, i. ...
Smarty allows template programming with and many more features. Other template engines also support these commands in templates. A regular expression (abbreviated as regexp, regex or regxp) is a string that describes or matches a set of strings, according to certain syntax rules. ...
In computer science control flow (or alternatively, flow of control) refers to the order in which the individual statements or instructions of an imperative program are performed or executed. ...
The server-side web template in the web page process, to produce dynamic web pages with the template engine. ...
Code example
Since Smarty separates PHP from HTML, you have two files: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html> <head> <title>{$title_text}</title> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> </head> <body> {* This is a little comment that won't be visible in HTML source *} <p>{$body_text}</p> </body><!-- this is a little comment that will be seen in source --> </html> In the business logic code you can configure Smarty to use this template: define('SMARTY_DIR', 'smarty-2.6.9/' ); require_once(SMARTY_DIR . 'Smarty.class.php'); $smarty = new Smarty; $smarty->config_dir = SMARTY_DIR; $smarty->template_dir = './tmpl'; $smarty->compile_dir = './tmpl/compile'; $smarty->compile_check = TRUE; $smarty->debugging = FALSE; $smarty->assign('title_text', 'TITLE: This is the Smarty basic example ...'); $smarty->assign('body_text', 'BODY: This is the message set using assign()'); $smarty->display('basic.htm'); See also - PRADO, a component-based web development framework for PHP5
- CakePHP, a PHP web application framework inspired by Ruby on Rails
- PHROOT, PHP Rapid Object Oriented Technology Framework Project
PRADO is a component-based and event-driven Web programming framework for PHP 5. ...
CakePHP is a web application framework written in PHP, modeled after the concepts of Ruby on Rails. ...
Ruby on Rails, often called RoR, or just Rails, is an open source web application framework written in Ruby that closely follows the Model-View-Controller (MVC) architecture. ...
PHROOT stands for PHP Rapid Object Oriented Technology ([fru:t]) and is a framework that is generally modeled for object oriented PHP after the server <-> client abstraction taken from the basic specifications and interfaces of the Java programming language. ...
External links - Smarty Home Page - official site.
- Download
- Smarty Resources list
- Forum - other languages
- Smarty users knowledge base Wiki
- PHP Templating with Smarty by Cezar Floroiu - Smarty tutorial
- Smarty vs. XML/XSLT - from DevPapers.com by Sergey Makogon
- Article "Templates, Gift from Heaven or Syntactic Junk Food?" by Nathan Oostendorp
- Chapter from Smarty PHP Template Programming and Applications book.
- Smarty Cheat Sheet Smarty Cheat Sheet for Templates Designers and Programmers
- Timestretch: PHP, MySQL, and Smarty Programming - Also see the PHP2 page for more.
- CakePHP
|