HTML_Template_IT::setOption()

HTML_Template_IT::setOption() – sets an option

Synopsis

require_once 'HTML/Template/IT.php';

int HTML_Template_IT::setOption ( string $option , mixed $value )

Описание

Sets an option. Please notice that changing some option might result in an unexpected behaviour of HTML_Template_IT.

Return value

int - Returns 1 on success, otherwise an IT_Error object.

Parameter

  • mixed $option - Option identifier

  • mixed $value - New value of the option

Options

Currently setOption allows to set only two options. Instead of using this method, access the properties directly on the template object.

Possible options:
Option Default value Описание
removeUnknownVariables TRUE If TRUE all template variables, which are not filled, are removed while parsing. This option is usually set by calling HTML_Template_IT::loadTemplatefile() or HTML_Template_IT::setTemplate().
removeEmptyBlocks TRUE If TRUE all blocks not containing any filled template variables are removed. This option is usually set by calling HTML_Template_IT::loadTemplatefile() or HTML_Template_IT::setTemplate().
clearCache FALSE If TRUE parsed blocks are not cached. If you don't know exactly what you do, just leave the default value.
clearCacheOnParse FALSE If TRUE the variable cache will be cleaned after parsing. If you don't know exactly what you do, just leave the default value.
openingDelimiter '{' Defines the character, every template variable has to start with. If you change this value, you have to call init() to reinitialise the template. If you don't know exactly what you do, just leave the default value.
closingDelimiter '}' Defines the character, every template variable has to end with. If you change this value, you have to call init() to reinitialise the template. If you don't know exactly what you do, just leave the default value.
blocknameRegExp '[\.0-9A-Za-z_-]+' The regular expression, thats used to parse block names. If you change this value, you have to call init() to reinitialise the template. If you don't know exactly what you do, just leave the default value.
variablenameRegExp '[\.0-9A-Za-z_-]+' The regular expression, thats used to parse template variable names. If you change this value, you have to call init() to reinitialise the template. If you don't know exactly what you do, just leave the default value.

Замечание

This function can not be called statically.

    Поддержать сайт на родительском проекте КГБ