{end:}

{end:} – closes an if or foreach block

Synopsis

Usage ( {end:} )

Description

adds a closing brace in PHP so that blocks of conditional HTML are shown correctly. You do not need to use {end:} tags if you are using HTML tag attributes like IF="a,b", as the closing HTML tag will indicate that.

Example

Setting variables for if

         

class example {
    function showDog() {
        return true;
    }

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

The template

   

{if:showStuff}Hello{end:}
{if:showDog()}Doggy{end:}

The compiled template

         
      
<?php if ($t->showStuff)  { ?>Hello<?php } ?>
<?php if ($t->showDog()) {  ?>Doggy<?php } ?>

The output

         
      
Hello
Doggy
creates a PHP if statement (Previous) adds an PHP else in an if block (Next)
Last updated: Sat, 16 Feb 2019 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report.
View this page in:
  • English

User Notes:

There are no user contributed notes for this page.