{if:variable} – creates a PHP if statement


Usage ( {if:variable} , {if:method()} )


creates an if statement, with the argument as a variable or method. You must close an if statement with an {end:} statement, and you may use {else:} with it.


Setting variables for if


class example {
    function showDog() {
        return true;

    function output() {
        $this->showStuff = true;

The template



Compiled template

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

The output

creates a PHP foreach loop (Previous) closes an if or foreach 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.