previous{foreach:variable,key,value} (Previous) (Next) {end:}next

View this page in Last updated: Sun, 21 Jun 2009
English | Brazilian Portuguese | Chinese | Dutch | French | German | Hungarian | Japanese | Polish | Russian | Spanish | Turkish

{if:variable}

{if:variable} – PHP の if 文を作成する

Synopsis

使用法 ( {if:variable} , {if:method()} )

Description

if 文を作成します。引数には変数あるいはメソッドを指定します。 最後は {end:} 文で閉じる必要があります。また、{else:} を使用することもできます。

Example

if 用の変数の設定

         

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
previous{foreach:variable,key,value} (Previous) (Next) {end:}next

Download Documentation Last updated: Sun, 21 Jun 2009
Do you think that something on this page is wrong? Please file a bug report or add a note.
User Notes:
There are no user contributed notes for this page.