setTemplate()

setTemplate() -- Sets the template.

Synopsis

require_once 'HTML/Template/Sigma.php';

mixed HTML_Template_Sigma::setTemplate (string $template [, boolean $removeUnknownVariables = TRUE [, boolean $removeEmptyBlocks = TRUE]])

Description

Sets the template. You can either load a template file from disk with loadTemplateFile() or set the template manually using this function.

Parameter

string $template

template content

boolean $removeUnknownVariables

remove unknown/unused variables?

boolean $removeEmptyBlocks

remove empty blocks?

Return value

return SIGMA_OK on success, error object on failure

Throws

Table 31-1. Possible PEAR_Error values

Error codeError messageReasonSolution
SIGMA_BLOCK_DUPLICATEThe name of a block must be unique within a template. Block 'blockname' found twice.The $template contains two blocks sharing the same nameCheck the $template and rename one of the the blocks to something else

See

see HTML_Template_Sigma::loadTemplateFile()

Note

This function can not be called statically.