setTemplate() – Sets the template.


require_once 'HTML/Template/Sigma.php';

mixed HTML_Template_Sigma::setTemplate ( string $template , boolean $removeUnknownVariables = true , boolean $removeEmptyBlocks = true )


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


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


Possible PEAR_Error values
Error code Error message Reason Solution
SIGMA_BLOCK_DUPLICATE The name of a block must be unique within a template. Block 'blockname' found twice. The $template contains two blocks sharing the same name Check the $template and rename one of the blocks to something else
SIGMA_CALLBACK_SYNTAX_ERROR Cannot parse template function: (error description) Bogus syntax for template function parameters. Fix the template function definition, pay special attention to quoting rules.


This function can not be called statically.

Sets the file root for templates. (Previous) Sets a variable value. (Next)
Last updated: Sat, 16 Feb 2019 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report.
View this page in:
  • English

User Notes:

There are no user contributed notes for this page.