Latte\Macros\CoreMacros::macroCapture PHP Method

macroCapture() public method

{capture $variable}
public macroCapture ( MacroNode $node, PhpWriter $writer )
$node Latte\MacroNode
$writer Latte\PhpWriter
    public function macroCapture(MacroNode $node, PhpWriter $writer)
    {
        $variable = $node->tokenizer->fetchWord();
        if (!Helpers::startsWith($variable, '$')) {
            throw new CompileException("Invalid capture block variable '{$variable}'");
        }
        $this->checkExtraArgs($node);
        $node->data->variable = $variable;
        return 'ob_start(function () {})';
    }