You are here: WikiStart/Docs/Options


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:

  1. The name of the option
  2. 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