JavaScript Editor Javascript validator     Web page editor 


addBlockfile() -- Adds a block contained in the file to the template


require_once 'HTML/Template/Sigma.php';

mixed HTML_Template_Sigma::addBlockfile (string $placeholder, string $block, string $filename)


Adds a block taken from a file to the template, changing a variable placeholder to a block placeholder.


string $placeholder

name of the variable placeholder

string $block

name of the block to be added

string $filename

template file that contains the block

Return value

return SIGMA_OK on success, error object on failure


see HTML_Template_Sigma::addBlock()


Table 47-1. Possible PEAR_Error values

Error codeError messageReasonSolution
SIGMA_BLOCK_EXISTSBlock '$block' already existsTried to add a block with a name that is already present in the templateChoose a different name for a new block
SIGMA_PLACEHOLDER_NOT_FOUNDVariable placeholder '$placeholder' not foundThere is no placeholder to replace by a new block in the templateCheck the spelling of the placeholder name
SIGMA_PLACEHOLDER_DUPLICATEPlaceholder '$placeholder' should be unique, found in multiple blocksA placeholder to be replaced by a new block should appear only in one placeCheck the spelling of the placeholder name, choose a different placeholder
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_BLOCK_DUPLICATEThe name of a block must be unique within a template. Block 'blockname' found twice.The added file contains a block that has the same name as the existing oneCheck the file and rename the block 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.

JavaScript Editor Javascript validator     Web page editor