17 parent::__construct($elements, array(),
$lineno);
22 $this->index = $pair[
'key']->getAttribute(
'value');
31 foreach (array_chunk($this->nodes, 2) as $pair) {
46 if ((
string) $key == (
string) $pair[
'key']) {
60 array_push($this->nodes, $key, $value);
70 $compiler->
raw(
'array(');
81 ->subcompile($pair[
'value'])
hasElement(Twig_Node_Expression $key)
Compiles a node to PHP code.
compile(Twig_Compiler $compiler)
Compiles the node to PHP.
getAttribute($name)
Gets an attribute.
__construct(array $elements, $lineno)
Abstract class for all nodes that represents an expression.
addElement(Twig_Node_Expression $value, Twig_Node_Expression $key=null)
subcompile(Twig_NodeInterface $node, $raw=true)
raw($string)
Adds a raw string to the compiled code.