Jump to content

Comparison of web template engines

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Datadoit (talk | contribs) at 14:42, 3 November 2010. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Content (from a database), and "presentation specifications" (in a web template), are combined (through the template engine) to mass-produce web documents.

Template:TemplateSystemSeries

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.

Types

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. [1] Such features include:

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:

<html>
   <h1>Hello {$X}</h1>
</html>

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

Benefits of using template engines include:

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

Comparison

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.

Engine (Implementation) Languages License Platform Variables Functions Includes Conditional Inclusion Looping Evaluation (Language) Assignment Errors & Exceptions i18n Natural Templates
ASP.net (Microsoft) C#, VB.net Proprietary Microsoft Windows Yes Yes Yes Yes Yes Yes Yes Yes
ASP.net (Mono) C# GNU LGPL Cross-Platform Yes Yes Yes Yes Yes Yes Yes Yes
Apache Velocity Java, C# Apache License Cross-Platform Yes Yes Yes Yes Yes Yes Yes Yes
Beilpuz PHP 5 GNU LGPL Cross-Platform Yes Yes Yes Yes Yes No Yes Yes
CheetahTemplate Python MIT License Cross-Platform Yes Yes Yes Yes Yes Yes Yes Yes
Chip Template Engine PHP, Perl open-source? Cross-Platform Yes Yes Yes Yes Yes No Yes No
CodeCharge Studio Classic ASP, C Sharp (programming language), VB.net, PHP, Perl, Java (programming language), ColdFusion Proprietary Microsoft Windows Yes Yes Yes Yes Yes Yes Yes No Yes Yes
csharptemplates C# New BSD .NET Yes No No No No No No No
CTPP C, C++, Perl, PHP, Python BSD-like Cross-Platform Yes Yes Yes Yes Yes No No Yes
Dermis Classic ASP MIT License Microsoft Windows Yes No Yes No Yes No Yes No
dbPager C++ GNU GPL Cross-Platform Yes Yes Yes Yes Yes Yes Yes Yes Yes
Django Python BSD-like Cross-Platform Yes Yes Yes Yes Yes Yes Yes Yes Yes
Djolt-objc Objective-C Apache License iPhone/MacOS Yes No No No Yes No No No
Dwoo PHP 5 BSD License Cross-Platform Yes Yes Yes Yes Yes Yes (PHP) Yes Yes
Dylan Server Pages Dylan language unknown unknown Yes Yes Yes Yes No? No No No
eRuby Ruby GPL / Ruby License Cross-Platform Yes Yes Yes Yes Yes Yes Yes Yes
Evoque Templating Python, Py3K AFL v3.0 Cross-Platform Yes Yes Yes Yes Yes Yes (Python) No Yes
FreeMarker Java BSD-like Cross-Platform Yes Yes Yes Yes Yes Yes Yes Yes
Genshi (templating language) Python BSD-like Cross-Platform Yes Yes Yes Yes Yes Yes (Python) Yes Yes Yes
Google-ctemplate C++ BSD License Cross-Platform Yes No Yes Yes Yes No No No
Grantlee Template System C++/Qt LGPL Cross-Platform Yes Yes Yes Yes Yes Yes Yes Yes
GvTags Groovy Apache License Cross-Platform Yes Yes Yes Yes Yes Yes (Groovy) Yes No
H2o PHP, Ruby MIT License Cross-Platform Yes Yes Yes Yes Yes No Yes Yes
Haml Ruby, PHP (WIP) MIT License Cross-Platform Yes Yes Yes Yes Yes Yes (Ruby) Yes Yes
Hamlets Java BSD Cross-Platform Yes Yes Yes Yes Yes No Yes Yes
jin-template Java, PHP LGPL Cross-Platform Yes No No No No No Yes No
JScore PHP + JS Proprietary Cross-Platform Yes Yes Yes Yes Yes Yes Yes Yes
JSP Weaver Java Proprietary Cross-Platform Yes Yes Yes Yes Yes Yes Yes Yes
Jasper framework Perl, PHP, C#, Java open-source? Cross-Platform Yes No No No No No No No
JavaServer Pages Java Proprietary Cross-Platform Yes Yes Yes Yes Yes Yes Yes Yes
Jenner JavaScript LGPL In-Browser Yes Yes No No Yes Yes Yes (if allowed by hosting application) Yes
Jinja Python BSD Cross-Platform Yes Yes Yes Yes Yes Yes (Python) Yes No
Jinja2 Python BSD Cross-Platform Yes Yes Yes Yes Yes Yes (Python) Yes Yes
Kalahari Python BSD-like Cross-Platform Yes Yes Through inheritance No Yes No Yes Yes
Kid (templating language) Python MIT Cross-Platform Yes Yes Yes Yes Yes Yes (Python) Yes Yes
Mako Python MIT Cross-Platform Yes Yes Yes Yes Yes Yes (Python) Yes No
Mars-Templater PHP 5 MIT License Cross-Platform Yes No No Yes Yes No No No
pyratemp Python MIT Cross-Platform Yes Yes Yes Yes Yes Yes (Python) Yes No
MiniTemplator PHP, Java, VB.net GNU LGPL Cross-Platform Yes Yes Yes Yes Yes No No No?
Template Blocks PHP 5 GNU GPL Cross-Platform Yes Yes Yes Yes Yes Yes (PHP) Yes Yes?
Toupl Any with OOP and String class support Apache License Cross-Platform Yes[2] Yes[2] Yes[2] Yes[2] Yes[2] Yes[2] Yes[2] Yes[2]
Obyx Obyx GNU GPL Unix/Mac OS X Yes Yes Yes Yes Yes Yes (Obyx) Yes Yes
Open Power Template PHP 5 BSD-like Cross-Platform Yes Yes Yes Yes Yes Yes (PHP) Yes Yes
Outline PHP 5 open-source Cross-Platform Yes Yes Yes Yes Yes Yes (PHP) Yes Yes?
PHAML PHP MIT License Cross-Platform Yes Yes Yes Yes Yes Yes (PHP) Yes Yes?
Phammable PHP 5 GNU GPL Cross-Platform Yes Yes Yes Yes Yes Yes (PHP) Yes Yes
PURE Unobtrusive Rendering Engine Javascript MIT License Cross-Platform Yes Yes Yes Yes Yes Yes Yes Yes
Scalate Scala, Java Apache License Cross-Platform Yes Yes Yes Yes Yes Yes (Scala) Yes Yes
RainTPL PHP GNU GPL Cross-Platform Yes Yes Yes Yes Yes Yes (PHP) Yes Yes
Smarty PHP GNU LGPL Cross-Platform Yes Yes Yes Yes Yes Yes (PHP) Yes Yes? Yes
TinyButStrong PHP GNU LGPL Cross-Platform Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes
StringTemplate Java (native), Python, C# BSD[3] Cross-Platform Yes No Yes Yes Yes No No No
SUIT Framework PHP, Python GNU LGPL Cross-Platform Yes Yes Yes Yes Yes Yes Yes Yes Yes
Template Attribute Language Python, PHP 5 open-source Cross-Platform Yes Yes Yes Yes Yes Yes Yes Yes Yes
Twig PHP BSD Cross-Platform Yes Yes Yes Yes Yes Yes (PHP) Yes Yes?
Vemplator PHP MIT License Cross-Platform Yes Yes Yes Yes Yes Yes (PHP) No No
vlibTemplate PHP Artistic License Cross-Platform Yes Yes Yes Yes Yes No No No
Deihro TemplateEngine PHP open-source Cross-Platform Yes Yes indirect No No No No No
Template Toolkit Perl, Python open-source Cross-Platform Yes Yes Yes Yes Yes Yes (Perl) Yes Yes
WebMacro Java open-source? Cross-Platform Yes Yes Yes Yes Yes Yes Yes Yes
QueryTemplates PHP 5, JavaScript MIT License Cross-Platform Yes Yes Yes Yes Yes Yes Yes Yes
FastTemplate PHP Artistic License Cross-Platform Yes Yes Yes Yes Yes No Yes No
ZeniTPL PHP new BSD Cross-Platform Yes No No No Yes No Yes No
Younicycle PHP 5, JavaScript, ActionScript Proprietary Cross-Platform Yes Yes Yes Yes Yes No Yes Yes
nTPL node.js, JavaScript MIT License Cross-Platform Yes Yes Yes Yes Yes Yes Yes Yes

LEGEND:

  • Engine (Implementation)= engine name
  • Languages= implemention language of the engine (not the template script language)
  • License= Software license agreement
  • Platform= Computing platform
  • Variables= script language power to use variables
  • Functions= script language power to use functions
  • Includes= script language power include external files
  • Conditional Inclusion= script language power to conditional includes
  • Looping= script language power to do loops (for, while) or recursion
  • Evaluation (Language)= script language power to do "eval command" (to the implemention language)
  • Assignment= set names and references to sub-templates (?)
  • Errors & Exceptions= engine output script errors.
  • i18n= Internationalization and localization feature
  • Natural Templates= the template can be a document as valid as the final result, the engine syntax doesn't break the document's structure

Notes

  1. ^ Themes : Premium WordPress Themes
  2. ^ a b c d e f g h Toupl is only compiler.Feature depend from target language
  3. ^ http://www.stringtemplate.org/license.html

See also