patTemplate is an XML based Templating Engine available at

The purpose of a Template Engine is to separate the processing of application data from the presentation of that data.

The advantages of using a Templating Engine are many:

  • They enable the business logic and the presentation layer to each be encapsulated. the logic and the presenation are separate entities.
  • They clarify the role of code in that the HTML template is HTML interspersed with the engines markup syntax.
  • They divide the labour between program and graphic developers. Graphic design can take place independently without the need to alter the underlying executable code.
  • They allow for reuse of HTML code, just as a programmer will break an application into functions.
  • They faciliate a single point of change within the presentation layer of the application.
  • Maintenance is reduced as the Template HTML cannot break the underlying code.
  • Whole themes or skins for an application are possible as all of the HTML is contained in files separate from the code.
  • Template files are not executatable and therefore do not pose a security risk if they are accessed directly by a browser.

Templating Engines in general follow the model-view-controller pattern that is well known to Java and other object orientated languages. In broad terms, the model represents that data in your database, the controller represents the executable code that accesses the data and manipulates it according to business rules, and the view represents the files that make up the HTML output of the application.

patTemplate interfaces with the controller (your PHP application) and provides a complete solution for your application's view. It does this via a PHP API and templates made up of mostly pure HTML, special XML tags and {VARIABLE} markups.

Last Updated ( Saturday, 09 July 2005 )