added __toString() to AutoEscape node class
authorfabien <fabien@93ef8e89-cb99-4229-a87c-7fa0fa45744b>
Tue, 22 Dec 2009 13:30:41 +0000 (13:30 +0000)
committerfabien <fabien@93ef8e89-cb99-4229-a87c-7fa0fa45744b>
Tue, 22 Dec 2009 13:30:41 +0000 (13:30 +0000)
git-svn-id: http://svn.twig-project.org/trunk@200 93ef8e89-cb99-4229-a87c-7fa0fa45744b

lib/Twig/Node/AutoEscape.php

index 5eefbd9..97c6e6d 100644 (file)
@@ -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()