Latte\Macros\CoreMacros::macroEndIf PHP Method

macroEndIf() public method

..}
public macroEndIf ( MacroNode $node, PhpWriter $writer )
$node Latte\MacroNode
$writer Latte\PhpWriter
    public function macroEndIf(MacroNode $node, PhpWriter $writer)
    {
        if ($node->data->capture) {
            if ($node->args === '') {
                throw new CompileException('Missing condition in {if} macro.');
            }
            return $writer->write('if (%node.args) ' . (isset($node->data->else) ? '{ ob_end_clean(); echo ob_get_clean(); }' : 'echo ob_get_clean();') . ' else ' . (isset($node->data->else) ? '{ $this->global->else = ob_get_clean(); ob_end_clean(); echo $this->global->else; }' : 'ob_end_clean();'));
        }
        return '}';
    }