previous{if:variable} (Previous) (Next) {else:}next

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

{end:}

{end:} – if ブロックあるいは foreach ブロックを閉じる

Synopsis

使用法 ( {end:} )

Description

PHP の閉じ波括弧を追加し、条件によって HTML 部が表示されるようにします。 HTML タグの属性で IF="a,b" のようにしている場合は、{end:} タグは不要です。 この場合、HTML の閉じタグがブロックの終了を表します。

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{if:variable} (Previous) (Next) {else:}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.