{method(arguments,#quoted arguments#)} -- PHP のメソッドコールを作成し、結果を表示する
説明
PHP のメソッドコールを作成します。引数の数は自由です。引数には、
変数あるいはリテラル (# で囲む) のいずれも使用可能です。
返り値が表示され、修正子に (変数のように) 渡されます。
例
例 47-1他のテンプレートの組み込み class example_page {
var $masterTemplate = "master.html";
var $bodyTemplate = "body.html";
function ucfirst($string) {
return ucfirst($string);
}
function includeBody() {
$template = new HTML_Template_Flexy();
$template->compile($this->bodyTemplate);
$template->outputObject($this);
}
} |
|
例 47-3コンパイルされたテンプレート <?php echo htmlspecialchars($t->ucfirst("this is the header")); ?>
<?php echo $t->includeBody(); ?>
Footer Goes Here. |
|
例 47-4コードの出力 This is the header
Hello World
Footer Goes Here. |
|