HTML.Template.java

How to use HTML.Template

The tag list

HTML.Template has five main tags - <tmpl_var>, <tmpl_if>, <tmpl_unless>, <tmpl_loop> and <tmpl_include>.

The if, unless and loop tags are block tags and need to be closed with corresponding </tmpl_if>, </tmpl_unless> and </tmpl_loop> tags.

In addition, the <tmpl_if> and <tmpl_unless> tag may have an optional <tmpl_else> part.

The <tmpl_include> tag is evaluated when the template is created, all other tags are evaluated when the template's output is requested.

The <tmpl_var> tag is the simplest tag, and may contain a single scalar value. <tmpl_var> can occur anywhere in the template.

Block tags may be nested, ie, an if tag may contain other tags, including other block tags.

Loop tags create a new namespace. All code within a loop block is evaluated for every iteration of the loop. See the howto for loops for more information. Variables outside the loop are not visible from inside the loop.