16 $nodes = array(
'node' => $node,
'attribute' => $attribute);
17 if (null !== $arguments) {
18 $nodes[
'arguments'] = $arguments;
21 parent::__construct(
$nodes, array(
'type' =>
$type,
'is_defined_test' =>
false,
'ignore_strict_check' =>
false,
'disable_c_ext' =>
false),
$lineno);
27 @trigger_error(sprintf(
'Using the "disable_c_ext" attribute on %s is deprecated since version 1.30 and will be removed in 2.0.', __CLASS__), E_USER_DEPRECATED);
30 if (function_exists(
'twig_template_get_attributes') && !$this->
getAttribute(
'disable_c_ext')) {
31 $compiler->
raw(
'twig_template_get_attributes($this, ');
33 $compiler->
raw(
'$this->getAttribute(');
37 $this->
getNode(
'node')->setAttribute(
'ignore_strict_check',
true);
42 $compiler->
raw(
', ')->subcompile($this->
getNode(
'attribute'));
45 $needFourth = $this->
getAttribute(
'ignore_strict_check');
46 $needThird = $needFourth || $this->
getAttribute(
'is_defined_test');
48 $needFirst = $needSecond || $this->
hasNode(
'arguments');
51 if ($this->
hasNode(
'arguments')) {
52 $compiler->
raw(
', ')->subcompile($this->
getNode(
'arguments'));
54 $compiler->
raw(
', array()');
74 class_alias(
'Twig_Node_Expression_GetAttr',
'Twig\Node\Expression\GetAttrExpression',
false);
raw($string)
Adds a raw string to the compiled code.
compile(Twig_Compiler $compiler)
Compiles the node to PHP.
subcompile(Twig_NodeInterface $node, $raw=true)
Abstract class for all nodes that represents an expression.
__construct(Twig_Node_Expression $node, Twig_Node_Expression $attribute, Twig_Node_Expression $arguments=null, $type, $lineno)