| | ユーザフォーラムで議論/質問 | マニュアル検索 | ハイライト | ハイライトオフ | ポータル | php spot |
{method(arguments,#quoted arguments#)}{method(arguments,#quoted arguments#)} – PHP のメソッドコールを作成し、結果を表示する
Synopsis
DescriptionPHP のメソッドコールを作成します。引数の数は自由です。引数には、 変数あるいはリテラル (# で囲む) のいずれも使用可能です。 返り値が表示され、修正子に (変数のように) 渡されます。
Example他のテンプレートの組み込み
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);
}
}
テンプレート内での includeBody のコールおよび ucfirst
{ucfirst(#this is the header#)}
{includeBody():h}
Footer Goes Here.
コンパイルされたテンプレート
<?php echo htmlspecialchars($t->ucfirst("this is the header")); ?>
<?php echo $t->includeBody(); ?>
Footer Goes Here.
コードの出力 This is the header Hello World Footer Goes Here. |
|
各種マニュアル:
PHPマニュアル |
PEARマニュアル |
Smarty(英語)マニュアル |
PHP-GTKマニュアル |
「{method(arguments,#quoted arguments#)}」をGoogle検索
|