2.1. Introduction

A template is a single file with a static text content and OPT template tags. They are parsed by the compiler and allow to modify or put the script data into the template. In the end, we have a ready output document.

All OPT template tags are enclosed within delimiters. By default, they are { and }, but they can be changed. XML Syntax Mode provides additional delimiters which emulate the XML language. In this manual we will assume that you use the default delimiters. Here are some sample tags:

{tag}
{multiline
	tag}	

The tag must not contain any delimiter character in its content; the code {tag } tag} is invalid.

The template processing consists of two stages. The first one is called compilation stage. The template is changed there to the PHP code by a group of special algorithms, in order to make the execution easier and faster. The compilation is done only, if the template source changes. The second stage is the execution - the compiled template is executed here by the PHP parser and produces the output (for example, the complete HTML code for the browser). Most of the instructions provided by OPT work both in the compilation and execution stage, but there is a small group that exists only in the first one, because they are designed just to support the template designer and the template compiler. It will be mentioned in such instructions.