21 parent::__construct(
array(
'names' => $names,
'values' => $values),
array(
'capture' => $capture,
'safe' =>
false),
$lineno,
$tag);
31 $values = $this->
getNode(
'values');
44 $compiler->
write(
'list(');
45 foreach ($this->
getNode(
'names') as $idx => $node) {
56 ->
write(
"ob_start();\n")
57 ->subcompile($this->
getNode(
'values'))
64 $compiler->
raw(
" = ('' === \$tmp = ob_get_clean()) ? '' : new Twig_Markup(\$tmp, \$this->env->getCharset())");
69 $compiler->
raw(
' = ');
72 $compiler->
write(
'array(');
73 foreach ($this->
getNode(
'values') as $idx => $value) {
84 ->
raw(
"('' === \$tmp = ")
85 ->subcompile($this->
getNode(
'values'))
86 ->raw(
") ? '' : new Twig_Markup(\$tmp, \$this->env->getCharset())")
94 $compiler->
raw(
";\n");
98 class_alias(
'Twig_Node_Set',
'Twig\Node\SetNode',
false);
raw($string)
Adds a raw string to the compiled code.
Represents a node in the AST.
subcompile(Twig_NodeInterface $node, $raw=true)
Represents a node in the AST.
Represents a node that captures any nested displayable nodes.
setNode($name, $node=null)
compile(Twig_Compiler $compiler)
Compiles the node to PHP.
__construct($capture, Twig_NodeInterface $names, Twig_NodeInterface $values, $lineno, $tag=null)
Create styles array
The data for the language used.
setAttribute($name, $value)
addDebugInfo(Twig_NodeInterface $node)
Adds debugging information.
write()
Writes a string to the compiled code by adding indentation.