Template engine (web)

Template engine (web)

A (web) template engine is software that is designed to process web templates and "content information" to produce output web documents. It runs in the context of a template system.

pecific types of template engines

"Template engine" is ordinarily included as a part of a web template system or application framework, and may be used also as preprocessor, filter, or template processor. Currently, template processing software is most frequently used in the context of development for the web.

XSLT is a template processing model designed by W3C. It is designed primarily for transformations on XML data (into web documents or other output).

Programming languages such as Perl, Ruby, C, and Java support template processing either natively, or through add-on libraries and modules. JavaServer Pages (JSP), PHP, and Active Server Pages (ASP with VBScript, JScript or other languages) are examples, themselves, of "web template engines".

Typical Features

Template engines typically include features common to most high-level programming languages, with an emphasis on features for processing plain text.

Such features include:
*variables and functions
*text replacement
*file inclusion (or transclusion)
*conditional evaluation and loops

A web template example

The accompanying illustration depicts a simplified processing model for a typical web template engine. The template engine produces a web page by processing the web template source file along with data from a relational database. The template engine replaces variables with specific values. In the illustration, substitution of $X by the database content (in page 01 "Mother", on page 02 "World").

A web template might look like this:

Hello {$X}

With additional template source code ...
templateAssign ('X', 'World');
... or, when specifying the relational database context:
$data [01] ='Mother'; $data [02] ='World';templateAssign('X', $data [$i] );

Benefits of using template engines

* encourages organization of source code into operationally-distinct layers (see e.g., MVC)
* enhances productivity by reducing unnecessary reproduction of effort
* enhances teamwork by allowing separation of work based on skill-set (e.g., artistic vs. technical)

= Comparison of template engines =

The following table lists the various template engines discussed on Wikipedia and a brief rundown of their features. The content here is a work-in-progress.

ee also

* Template processor
* Layout engine
* Macro preprocessor
* Preprocessor
* Smarty (PHP: Template engine)
* Mytemplate (PHP: MyTemplate engine)
* vlibTemplate (PHP: Template engine)
* Jasper framework
* Virtual machine
* Bytecode

External links

Other template engines on template systems:
* [http://2006.rmll.info/conf_423 Acceleo - MDA template based Code generator based on Eclipse and EMF]
* [http://sourceforge.net/projects/blitz-templates Blitz templates (PHP-module, written in C, very fast, OO, MVC)] , [http://alexeyrybak.com/blitz/blitz_en.html documentation] . Probably the fastest engine for PHP, [http://alexeyrybak.com/blitz/lebowski-bench-big.gifsee benchmarks] , [http://www.kmit.sk/~smok/#mystuff Simple Blitz tutorial]
* [http://beilpuz.get-mike.de Beilpuz (PHP 5)]
* [http://ctpp.havoc.ru/en/ CT++ Crossplatform C/C++/Perl and PHP Template engine]
* [http://code.divineaspirations.net/chip Chip]
* [http://www.typea.net/software/contemplate/ Contemplate]
* [http://dwoo.org/ Dwoo (PHP 5, mostly Smarty compatible)]
* [http://www.cs.usfca.edu/~parrt/papers/mvc.templates.pdf Enforcing Strict Model-View Separation in Template Engines]
* [http://evoque.gizmojo.org Evoque Templating] - sandbox-able, lightweight, [http://evoque.gizmojo.org/benchmark/ fast] text templating for Python, with automatic Cross-site scripting protection
* [http://rubyforge.org/projects/galena/ Galena: Another Ruby Template Engine]
* [http://www.liquidmarkup.org/ Liquid Ruby template engine]
* [http://xtargets.com/cms/Tutorials/Matlab-Programming/MTemplate-Matlab-Code-Generation-and-Text-Templating.html Matlab template engine]
* [http://www.freemarker.org FreeMarker]
* [http://pear.php.net/package/HTML_Template_IT HTML_Template_IT]
* [http://outline.mindplay.dk Outline] - PHP template engine, borrows from Smarty and PHP syntax - very small footprint
* [http://trac.php-tools.net/patTemplate/ patTemplate]
* [http://sourceforge.net/projects/php-templates php_templates (PHP-module, written in C, very fast)]
* [http://smarttemplate.sourceforge.net/ SmartTemplate]
* [http://smarty.php.net/ Smarty]
* [http://www.startonweb.com/ startonweb]
* [http://www.stringtemplate.org/ StringTemplate]
* [http://www.template-toolkit.org/ Template::Toolkit]
* [http://search.cpan.org/~rhandom/Template-Alloy-1.008/ Template::Alloy]
* [http://templatelite.sourceforge.net/ Template Lite]
* [http://www.tinybutstrong.com/ TinyButStrong]
* [http://vlib.clausvb.de/ vLIB]
* [http://www.greaterscope.net/projects/Vemplator Vemplator]

Template engine usage:
* [http://g-rossolini.developpez.com/comparatifs/php/templates/ How to use the main PHP template engines, and a comparison chart (French)]

Wikimedia Foundation. 2010.

Игры ⚽ Нужно сделать НИР?

Look at other dictionaries:

  • Template engine — may refer to any of the following:* For all uses in generating output from templates, see template processor * For use exclusively in a web template system, see template engine (web) * For use exclusively in word processing applications, see mail …   Wikipedia

  • Template Engine — Dieser Artikel wurde aufgrund von inhaltlichen Mängeln auf der Qualitätssicherungsseite der Redaktion Informatik eingetragen. Dies geschieht, um die Qualität der Artikel aus dem Themengebiet Informatik auf ein akzeptables Niveau zu bringen. Hilf… …   Deutsch Wikipedia

  • XML template engine — A XML template engine (or XML template processor ) is a specialized template processor for XML input and/or output, working in a XML template system context. There are two main types: * XML suite standards compliant engines: ** XSLT engines ,… …   Wikipedia

  • Smarty Template Engine — Smarty Entwickler: Monte Ohrt, Andrei Zmievski Aktuelle Version: 2.6.22 (17. Dezember 2008) Betriebssystem: plattformunabhängig Pr …   Deutsch Wikipedia

  • Template — may mean:*a stencil, pattern or overlay used in graphic arts (drawing, painting, etc) and sewing to replicate letters, shapes or designs *a pre developed page layout in electronic or paper media used to create new pages from the same design,… …   Wikipedia

  • Template-Toolkit — Entwickler Andy Wardley Aktuelle Version 2.22 (21. Juli 2009) Betriebssystem Linux, Mac OS X, Windows, u. a. Kategorie Programm und Bibliothekssammlun …   Deutsch Wikipedia

  • Template processor — A template processor (also known as a template engine or a template parser )is software or a software component that is designed to combine one or more templates with a data model to produceone or more result documents.cite book last = Niemeyer… …   Wikipedia

  • Web template system — A Web template system describes the software and methodologies used to produce web pages and for deployment on websites and delivery over the internet. Such systems process web templates, using a template engine. It is a web publishing tool… …   Wikipedia

  • Web template — A web template is a tool used to separate content from presentation in web design, and for mass production of web documents. It is a basic component of a web template system. Web templates can be used to set up any type of website. In its… …   Wikipedia

  • Web crawler — For the search engine of the same name, see WebCrawler. For the fictional robots called Skutters, see Red Dwarf characters#The Skutters. Not to be confused with offline reader. A Web crawler is a computer program that browses the World Wide Web… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”