Nextras\Forms\Bridges\Latte\Macros\BaseInputMacros::macroLabel PHP Метод

macroLabel() публичный Метод

..}
public macroLabel ( MacroNode $node, PhpWriter $writer )
$node Latte\MacroNode
$writer Latte\PhpWriter
    public function macroLabel(MacroNode $node, PhpWriter $writer)
    {
        $class = get_class($this);
        $words = $node->tokenizer->fetchWords();
        if (!$words) {
            throw new CompileException("Missing name in {{$node->name}}.");
        }
        $name = array_shift($words);
        return $writer->write(($name[0] === '$' ? '$_input = is_object(%0.word) ? %0.word : $_form[%0.word];' : '$_input = $_form[%0.word];') . 'if ($_label = $_input->%1.raw) echo ' . $class . '::label($_label->addAttributes(%node.array), $_input, %2.var)', $name, $words ? 'getLabelPart(' . implode(', ', array_map([$writer, 'formatWord'], $words)) . ')' : 'getLabel()', (bool) $words);
    }