replaceBlockfile()

replaceBlockfile() -- Replaces an existing block with new content from a file.

Synopsis

require_once 'HTML/Template/Sigma.php';

mixed HTML_Template_Sigma::replaceBlockfile (string $block, string $filename [, boolean $keepContent = FALSE])

Description

Replaces an existing block with new content from a file.

Paramètres

chaîne de caractères $block

name of a block to replace

chaîne de caractères $filename

template file that contains the block

booléen $keepContent

TRUE if the parsed contents of the block should be kept

Valeur retournée

return SIGMA_OK on success, error object on failure

Voir aussi

see HTML_Template_Sigma::replaceBlock(), HTML_Template_Sigma::addBlockfile()

Valeurs renvoyées

Tableau 42-1. Valeurs PEAR_Error possibles

Error codeError messageReasonSolution
SIGMA_BLOCK_NOT_FOUNDCannot find block '$block'There is no block $block in the templateCheck the block name spelling, check whether you added all the necessary blocks to the template
SIGMA_BLOCK_DUPLICATEThe name of a block must be unique within a template. Block 'blockname' found twice.The loaded block contains a subblock that has the same name as the existing oneCheck the file contents and rename the block to something else
SIGMA_TPL_NOT_FOUNDCannot read the template file '$filename'File is unreadable for some reasonCheck if the file exists and has correct permissions set
SIGMA_CACHE_ERRORCannot save template file 'filename'A prepared template file cannot be savedCheck if the directory for prepared templates cache exists and is writeable for your script
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.

Note

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