Documentation Menu

1.5 Template Project

The Joomla! Documentation Working Group is running a project to develop detailed reference and tutorial material on Joomla! 1.5 templates.  There is a project page on the documentation wiki where you can see the work in progress and help us by contributing your knowledge.

Who's Online

We have 9 guests online

Help Site License

The Joomla! Help Site content is copyright © 2005 - 2008 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution NonCommercial ShareAlike 2.5. Some parts of this website may be subject to other licenses.
Home arrow patTemplate arrow Preface arrow Introduction

Introduction PDF Print E-mail

patTemplate is an XML based Templating Engine available at http://www.php-tools.de.

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 )
 
Next >