loadTemplateFile()

loadTemplateFile() -- Loads a template file.

Synopsis

require_once 'HTML/Template/Sigma.php';

mixed HTML_Template_Sigma::loadTemplateFile (string $filename [, boolean $removeUnknownVariables = TRUE [, boolean $removeEmptyBlocks = TRUE]])

Описание

Loads a template file. If caching is on, then it checks whether a "prepared" template exists. If it does, it gets loaded instead of the original, if it does not, then the original gets loaded and prepared and then the prepared version is saved. addBlockfile() and replaceBlockfile() implement quite the same logic.

Параметр

string $filename

filename

boolean $removeUnknownVariables

remove unknown/unused variables?

boolean $removeEmptyBlocks

remove empty blocks?

Возвращаемое значение

return SIGMA_OK on success, error object on failure

Throws

Таблица 42-1. Возможные значения PEAR_Error

Error codeError messageReasonSolution
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 loaded file contains two blocks sharing the same nameCheck the file 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.

См. также

see HTML_Template_Sigma::setTemplate(), HTML_Template_Sigma::$removeUnknownVariables, HTML_Template_Sigma::$removeEmptyBlocks

Заметка

Эта функция не должна вызываться статически.


HIVE: All information for read only. Please respect copyright!
Hosted by hive йца: йХЕБЯЙЮЪ ЦНПНДЯЙЮЪ АХАКХНРЕЙЮ