Wact supports plugable template file organization schemes.
File organizational schemes are used to connect compiled templates and serialized variable definition files with their source code. They can also implement search paths where the source for a given compiled file may be in one of many directories.
File schemes are limited only by the need to be able to find a source file based on the file name of its compiled equivalent and the need to be able to implement the compile all command for the templates and variable definition files of an application.
Two schemes are provided.
In the simple scheme, all template files are stored in a single directory. The directory is divided into two sub directories one for all the source files and one for all of the compiled template files. These directories must be called source and compiled, respectively.
If a file is not found in the template directory, then WACT looks in its own default directory for the template source. This is how default WACT error messages get merged with user programs.
By default, the simple file scheme looks for a directory called templates in the current directory. You may change this location by using a define statement.
The multi-lang file scheme builds upon the simple file using search paths to define multiple languages for templates. With this file scheme, the template/source directory is further divided into subdirectories based on the type of files. Templates are stored in the templates directory, while string files are stored in a lang directory. The lang directory is further subdivided by language. The language to pick is set as a define in the program.
The constant TMPL_FILESCHEME_PATH defines which template file organization scheme should be used. By default it’s value is set like this:
if (!defined ('TMPL_FILESCHEME_PATH')) { define ('TMPL_FILESCHEME_PATH', FRAMEWORK_ROOT . 'template/fileschemes/simple/'); }
This can be switched to the multi-lang scheme by defining it yourself in your code
define ('TMPL_FILESCHEME_PATH', FRAMEWORK_ROOT . 'template/fileschemes/multilang/');