From: fabien Date: Fri, 8 Jan 2010 16:14:59 +0000 (+0000) Subject: added a getName() method in the default Template abstract class X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=2c2b10097b6913d7df36bced4aa16f2dd08228d3;p=konrad%2Ftwig.git 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 --- diff --git a/lib/Twig/Node/Module.php b/lib/Twig/Node/Module.php index eec2d12..c7cb37a 100644 --- a/lib/Twig/Node/Module.php +++ b/lib/Twig/Node/Module.php @@ -202,6 +202,17 @@ class Twig_Node_Module extends Twig_Node implements Twig_NodeListInterface ; } + // original template name + $compiler + ->write("public function getName()\n", "{\n") + ->indent() + ->write('return ') + ->string($this->filename) + ->raw(";\n") + ->outdent() + ->write("}\n\n") + ; + $compiler ->outdent() ->write("}\n") diff --git a/lib/Twig/Template.php b/lib/Twig/Template.php index d37e7be..ee08910 100644 --- a/lib/Twig/Template.php +++ b/lib/Twig/Template.php @@ -34,4 +34,6 @@ abstract class Twig_Template extends Twig_Resource implements Twig_TemplateInter return ob_get_clean(); } + + abstract protected function getName(); }