TracNav menu
- Home
-
Documentation
- Introduction
- Creating templates
-
Adding variables
- Default values
- Accessing variables from other templates
- Using the simpleCondition template
- Creating conditional templates
- Creating alternating rows?
-
Advanced features
- Reading templates from different data sources
- Variable Modifiers
- Improving performance with template caches
- Output Filters
- Input Filters
- Tag Reference
- FAQ
-
Extending patTemplate
- Variable Modifiers
- Template Readers
- Output Filters
- Input Filters
- Custom Tags
- Template Cache
- Template Dumpers
- Download
Using options
patTemplate allows you to influence its behaviour by setting several of its options. To set an option, the setOption method can be used. It accepts two arguments:
- The name of the option
- The value of the option
Example:
$tmpl = new patTemplate();
$tmpl->setOption('allowFunctionsAsDefault', true);
Available options
The following table shows all available options:
| Option | Description | Possible values |
| maintainBc | Whether patTemplate should maintain backwards compatibility to version 2.x. If set to true you may use empty and default in <patTemplate:sub/> tags instead of __empty and __default | true or false |
| defaultFunction | Name of the template function (i.e. user defined tag) that should be called if an unknown tag is encountered | any string |
| allowFunctionsAsDefault | Whether it is allowed to specify a PHP function as a defaul value for variables. | true or false |
