setTemplate()

setTemplate() – テンプレートを設定する

Synopsis

require_once 'HTML/Template/Sigma.php';

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

Description

テンプレートを設定します。 loadTemplateFile() を使用してディスクからテンプレートファイルを読み込むか、 あるいはこの関数を使用して手動でテンプレートを設定します。

Parameter

string $template

テンプレートの内容。

boolean $removeUnknownVariables

未知の/未使用の変数を削除するか?

boolean $removeEmptyBlocks

空のブロックを削除するか?

Return value

成功した場合に SIGMA_OK、失敗した場合にエラーオブジェクトを返します。

Throws

Possible PEAR_Error values
エラーコード エラーメッセージ 原因 対応
SIGMA_BLOCK_DUPLICATE The name of a block must be unique within a template. Block 'blockname' found twice. $template にふたつのブロックが含まれており、それらの名前が重複しています $template を調べ、いずれかのブロック名を別のものに変更します
SIGMA_CALLBACK_SYNTAX_ERROR Cannot parse template function: (error description) テンプレート関数のパラメータが間違っています テンプレート関数の定義を修正します。 クォートのしかた に注意してください

See

HTML_Template_Sigma::loadTemplateFile() も参照ください。

Note

This function can not be called statically.