Latte\MacroNode::setArgs PHP Method

setArgs() public method

public setArgs ( $args )
    public function setArgs($args)
    {
        $this->args = (string) $args;
        $this->tokenizer = new MacroTokens($this->args);
    }

Usage Example

 public function macroLabel(Latte\MacroNode $node, Latte\PhpWriter $writer)
 {
     while ($node->parentNode) {
         if ($node->parentNode->name == 'gpspicker') {
             $cmd = 'if ($_label = $_gpspicker->getPartialLabel(%node.word)) echo $_label->addAttributes(%node.array)';
             if ($node->isEmpty = substr($node->args, -1) === '/') {
                 $node->setArgs(substr($node->args, 0, -1));
                 return $writer->write($cmd);
             } else {
                 return $writer->write($cmd . '->startTag()');
             }
         }
         $node = $node->parentNode;
     }
     throw new CompileException('{gpspicker:label} can be used only within {gpspicker} macro.');
 }
All Usage Examples Of Latte\MacroNode::setArgs