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.

Paramètres

chaîne de caractères $template

template content

booléen $removeUnknownVariables

remove unknown/unused variables?

booléen $removeEmptyBlocks

remove empty blocks?

Valeur retournée

return SIGMA_OK on success, error object on failure

Valeurs renvoyées

Tableau 42-1. Valeurs PEAR_Error possibles

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
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.

Voir aussi

see HTML_Template_Sigma::loadTemplateFile()

Note

Cette fonction ne peut pas être appelée de façon statique.