21 parent::__construct(array(
'names' => $names,
'values' => $values), array(
'capture' => $capture,
'safe' =>
false),
$lineno,
$tag);
31 $values = $this->
getNode(
'values');
49 $compiler->
write(
'list(');
50 foreach ($this->
getNode(
'names') as $idx => $node) {
61 ->
write(
"ob_start();\n")
62 ->subcompile($this->
getNode(
'values'))
69 $compiler->
raw(
" = ('' === \$tmp = ob_get_clean()) ? '' : new Twig_Markup(\$tmp, \$this->env->getCharset())");
74 $compiler->
raw(
' = ');
77 $compiler->
write(
'array(');
78 foreach ($this->
getNode(
'values') as $idx => $value) {
89 ->
raw(
"('' === \$tmp = ")
90 ->subcompile($this->
getNode(
'values'))
91 ->raw(
") ? '' : new Twig_Markup(\$tmp, \$this->env->getCharset())")
99 $compiler->
raw(
";\n");
setNode($name, $node=null)
Sets a node.
Compiles a node to PHP code.
Represents a node in the AST.
getAttribute($name)
Gets an attribute.
addDebugInfo(Twig_NodeInterface $node)
Adds debugging information.
compile(Twig_Compiler $compiler)
Compiles the node to PHP.
setAttribute($name, $value)
Sets an attribute.
subcompile(Twig_NodeInterface $node, $raw=true)
Represents a node in the AST.
__construct($capture, Twig_NodeInterface $names, Twig_NodeInterface $values, $lineno, $tag=null)
raw($string)
Adds a raw string to the compiled code.
write()
Writes a string to the compiled code by adding indentation.
getNode($name)
Gets a node by name.