HTML_Template_Flexy can either be configured globally or on each instance, using an associated array. The easiest way to configure HTML_Template_Flexy is to use ini files (although you may also like to consider the PEAR::Config class, or your own configuration system)
Example 31-1. This is a typical configuration file for HTML_Template_Flexy
|
To use this ini file with HTML_Template_Flexy, (and Possibly any other classes that use options like this)
Example 31-2. Setting the default options
|
Alternatively you can set (or override) the configuration when you instantate the class
Example 31-3. Setting the default options
|
This is the directory where all your templates are located
The directory where the compiled templates will be stored, This directory should be writable by the web server
Normally 0, means that the template will only be compiled once (or if the template file is altered), this is only really usefull if you are developing filters and need to test the result.
The default debugging level (default 0=off), 1= shows some debugging information
Default is 'en' - english. The language use for reading/writing templates. Currently it is only used in the compiled files filename = eg. originalname.html.en.php
Flexy uses get_text() internally if it is installed, and will replace all strings in a HTML page with the return value of get_text(). - This enables the creation of multilanguage sites with a little less pain.
A file {templatename}.strings.serial is created for each file that is parsed, you can use this with PHP's unserialize function to retrieve an array of all the strings in a file. (for translating), or just use the tool xgettext.
Default is 'Standard' - The standard Tokenizer Driver engine. Other engines available are regex (similar to Xipe's engine). You can use this field to write your own engines, either based Off the core code, or totally seperate..