From: fabien Date: Fri, 8 Jan 2010 15:26:17 +0000 (+0000) Subject: fixed Twig_Node_Include X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=53ebfec20ca52219882137c0fb2cad4630768299;p=konrad%2Ftwig.git fixed Twig_Node_Include git-svn-id: http://svn.twig-project.org/trunk@221 93ef8e89-cb99-4229-a87c-7fa0fa45744b --- diff --git a/lib/Twig/Node/Include.php b/lib/Twig/Node/Include.php index d32e69b..0da7d2f 100644 --- a/lib/Twig/Node/Include.php +++ b/lib/Twig/Node/Include.php @@ -17,7 +17,7 @@ * @author Fabien Potencier * @version SVN: $Id$ */ -class Twig_Node_Include extends Twig_Node +class Twig_Node_Include extends Twig_Node implements Twig_NodeListInterface { protected $expr; protected $sandboxed; @@ -37,6 +37,32 @@ class Twig_Node_Include extends Twig_Node return get_class($this).'('.$this->expr.')'; } + public function getNodes() + { + if (null === $this->variables) + { + return array(new Twig_Node_Text('', -1)); + } + else + { + return array($this->variables); + } + + return $this->variables->getNodes(); + } + + public function setNodes(array $nodes) + { + if (isset($nodes[0]) && -1 === $nodes[0]->getLine()) + { + $this->variables = null; + } + else + { + $this->variables = $nodes[0]; + } + } + public function getIncludedFile() { return $this->expr;