Project

General

Profile

TEMPLATE specification » History » Version 2

Version 1 (Redmine Admin, 01/05/2010 09:28 AM) → Version 2/11 (Redmine Admin, 01/05/2010 09:30 AM)

h1. TEMPLATE specification

This is a new specification for a simple template format: raw HTML containing placeholders.

This template specification provides no looping capability. However, using the *part template*, it is possible to repeat a template section.



h2. Full versus part template

h3. Full template

In case of a full template, the template file is a valid HTML file, including HTML, HEAD and BODY directives.

h3. Partial template

Partial template is made of HTML code, excluding any of the HTML, HEAD, BODY directives.

h2. Place holders and reserved keywords

h3. syntax

Placeholders and reserved keywords are delimited within template by '%' (percent) sign surrounding keyword:<pre>Here will the %placeholder% be replaced.</pre>
+(to be discussed)+

h3. Rules

Placeholders and reserved keywords are made of any character from within [a-zA-Z0-9], and are case intolerant: _ABC_ and _abc_ designate the same placeholder, but _%ABC%_ may not be replaced properly if match is against _%abc%_.

h3. Reserved keywords

Some Placeholders are reserved for futur usage.

* *include* include
* do
* loop
* while
* repeat
* break
* exit

h2. Using a template

Using such a template in PHP is as easy as:

<pre>

</pre>