{end:}

{end:} – closes an if or foreach block

Synopsis

Usage ( {end:} )

Описание

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.

Пример

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
    Поддержать сайт на родительском проекте КГБ