Browse code

added a getName() method in the default Template abstract class

git-svn-id: http://svn.twig-project.org/trunk@223 93ef8e89-cb99-4229-a87c-7fa0fa45744b

fabien authored on 08/01/2010 16:14:59
Showing 2 changed files
... ...
@@ -202,6 +202,17 @@ class Twig_Node_Module extends Twig_Node implements Twig_NodeListInterface
202 202
       ;
203 203
     }
204 204
 
205
+    // original template name
206
+    $compiler
207
+      ->write("public function getName()\n", "{\n")
208
+      ->indent()
209
+      ->write('return ')
210
+      ->string($this->filename)
211
+      ->raw(";\n")
212
+      ->outdent()
213
+      ->write("}\n\n")
214
+    ;
215
+
205 216
     $compiler
206 217
       ->outdent()
207 218
       ->write("}\n")
... ...
@@ -34,4 +34,6 @@ abstract class Twig_Template extends Twig_Resource implements Twig_TemplateInter
34 34
 
35 35
     return ob_get_clean();
36 36
   }
37
+
38
+  abstract protected function getName();
37 39
 }