| | ユーザフォーラムで議論/質問 | マニュアル検索 | ハイライト | ハイライトオフ | ポータル | php spot |
{if:variable}{if:variable} – PHP の if 文を作成する
Synopsis
Descriptionif 文を作成します。引数には変数あるいはメソッドを指定します。 最後は {end:} 文で閉じる必要があります。また、{else:} を使用することもできます。 Exampleif 用の変数の設定
class example {
function showDog() {
return true;
}
function output() {
$this->showStuff = true;
.........
$template->outputObject($this);
}
}
テンプレート
{if:showStuff}Hello{end:}
{if:showDog()}Doggy{end:}
コンパイルされたテンプレート
<?php if ($t->showStuff) { ?>Hello<?php } ?>
<?php if ($t->showDog()) { ?>Doggy<?php } ?>
出力
Hello
Doggy
|
|
各種マニュアル:
PHPマニュアル |
PEARマニュアル |
Smarty(英語)マニュアル |
PHP-GTKマニュアル |
「{if:variable}」をGoogle検索
|