22 parent::__construct(array(
'expr' => $expr,
'variables' => $variables), array(
'only' => (Boolean) $only,
'ignore_missing' => (Boolean) $ignoreMissing),
$lineno,
$tag);
43 $compiler->
raw(
'->display(');
47 $compiler->
raw(
");\n");
52 ->write(
"} catch (Twig_Error_Loader \$e) {\n")
54 ->write(
"// ignore missing template\n")
65 ->
write(
"\$this->env->loadTemplate(")
66 ->subcompile($this->
getNode(
'expr'))
71 ->
write(
"\$template = \$this->env->resolveTemplate(")
72 ->subcompile($this->
getNode(
'expr'))
82 if (null === $this->
getNode(
'variables')) {
83 $compiler->
raw(
'$context');
86 ->
raw(
'array_merge($context, ')
87 ->subcompile($this->
getNode(
'variables'))
92 if (null === $this->
getNode(
'variables')) {
93 $compiler->
raw(
'array()');
Compiles a node to PHP code.
outdent($step=1)
Outdents the generated code.
Represents an include node.
Represents a node in the AST.
compile(Twig_Compiler $compiler)
Compiles the node to PHP.
getAttribute($name)
Gets an attribute.
addDebugInfo(Twig_NodeInterface $node)
Adds debugging information.
Abstract class for all nodes that represents an expression.
addGetTemplate(Twig_Compiler $compiler)
addTemplateArguments(Twig_Compiler $compiler)
subcompile(Twig_NodeInterface $node, $raw=true)
raw($string)
Adds a raw string to the compiled code.
Represents a displayable node in the AST.
write()
Writes a string to the compiled code by adding indentation.
__construct(Twig_Node_Expression $expr, Twig_Node_Expression $variables=null, $only=false, $ignoreMissing=false, $lineno, $tag=null)
getNode($name)
Gets a node by name.