HTML.Template.java

How to use HTML.Template

The <tmpl_unless> tag

This tag is the exact opposite of the <tmpl_if> tag. A <tmpl_unless> block is displayed if its control variable evaluates to false. If the control variable evaluates to true, then the else block, if any, is displayed instead.

Repeat the examples in the tmpl_if statement, replacing all <tmpl_if> with <tmpl_unless> and </tmpl_if> with </tmpl_unless>, and swapping the output.

<tmpl_unless name>
	You did not give a name
<tmpl_else>
	Your name is <tmpl_var name>
</tmpl_unless>

Use the same java code.

import HTML.Template;

public class Test2 {
	public static void main(String [] args) {
		try {
			// Create the Template object
			Template t = new Template("test2.tmpl");

			// Set a parameter
			t.setParam("name", "Philip");

			System.out.print(t.output());
		} catch(Exception e) {
		}
	}
}