From: fabien Date: Tue, 22 Dec 2009 13:30:41 +0000 (+0000) Subject: added __toString() to AutoEscape node class X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=e24646093011d3268cec3cf5deeb3e9f44a5c9e2;p=konrad%2Ftwig.git added __toString() to AutoEscape node class git-svn-id: http://svn.twig-project.org/trunk@200 93ef8e89-cb99-4229-a87c-7fa0fa45744b --- diff --git a/lib/Twig/Node/AutoEscape.php b/lib/Twig/Node/AutoEscape.php index 5eefbd9..97c6e6d 100644 --- a/lib/Twig/Node/AutoEscape.php +++ b/lib/Twig/Node/AutoEscape.php @@ -30,7 +30,14 @@ class Twig_Node_AutoEscape extends Twig_Node implements Twig_NodeListInterface public function __toString() { - return get_class($this).'('.$this->value.')'; + $repr = array(get_class($this).'('.($this->value ? 'on' : 'off')); + foreach (explode("\n", $this->body) as $line) + { + $repr[] = ' '.$line; + } + $repr[] = ')'; + + return implode("\n", $repr); } public function getNodes()