Project

General

Profile

TEMPLATE specification » History » Version 2

« Previous - Version 2/11 (diff) - Next » - Current version
Redmine Admin, 01/05/2010 09:30 AM


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.

Full versus part template

Full template

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

Partial template

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

Place holders and reserved keywords

syntax

Placeholders and reserved keywords are delimited within template by '%' (percent) sign surrounding keyword:

Here will the %placeholder% be replaced.

(to be discussed)

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.

Reserved keywords

Some Placeholders are reserved for futur usage.

  • include
  • do
  • loop
  • while
  • repeat
  • break
  • exit

Using a template

Using such a template in PHP is as easy as: