Configuration
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)
To use this ini file with HTML_Template_Flexy, (and Possibly any other classes that use options like this)
Example 25-2. Setting the default options | <?php
$config = parse_ini_file('example.ini',TRUE);
foreach($config as $class=>$values) {
$options = &PEAR::getStaticProperty($class,'options');
$options = $values;
}
?> |
|
Alternatively you can set (or override) the configuration when you instantate the class
Example 25-3. Setting the default options | <?php
$options = array(
'templateDir' => '/home/me/Projects/myapplication/templates',
'compileDir' => '/home/me/Projects/myapplication/compiled_templates',
'forceCompile' => 0,
'debug' => 0,
'locale' => 'en',
'compiler' => 'Standard',
);
$template = new HTML_Template_Flexy($options);
?> |
|