previous{end:} (Previous) (Next) <FORM NAME="name"next

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

{else:}

{else:} – adds an PHP else in an if block

Synopsis

Usage ( {else:} )

Description

adds an else statement in PHP so that blocks of conditional HTML are shown correctly.

Example

Setting variables for if

         

class example {
   
    function output() {
        
        $this->showStuff = false;
        
        .........
        $template->outputObject($this);
    }
}

Else in template

   

{if:showStuff}Hello{else:}World{end:}

Compiled template

         
      
<?php if ($t->showStuff)  { ?>Hello<?php } else { ?>World<<?php } ?>

The output

         
      
World
previous{end:} (Previous) (Next) <FORM NAME="name"next

Download Documentation Last updated: Sun, 18 Oct 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.