function AssignTemplateVariable::compile
Overrides Node::compile
File
-
vendor/
twig/ twig/ src/ Node/ Expression/ Variable/ AssignTemplateVariable.php, line 24
Class
Namespace
Twig\Node\Expression\VariableCode
public function compile(Compiler $compiler) : void {
/** @var TemplateVariable $var */
$var = $this->nodes['var'];
$compiler->addDebugInfo($this)
->write('$macros[')
->string($var->getName($compiler))
->raw('] = ');
if ($this->getAttribute('global')) {
$compiler->raw('$this->macros[')
->string($var->getName($compiler))
->raw('] = ');
}
}