Pārlūkot izejas kodu

[Templating] added getPath() to TemplateReferenceInterface as it's used in the child class in FrameworkBundle

Fabien Potencier 14 gadi atpakaļ
vecāks
revīzija
e8144e473e

+ 7 - 0
src/Symfony/Component/Templating/TemplateReference.php

@@ -75,4 +75,11 @@ class TemplateReference implements TemplateReferenceInterface
         return $this->parameters;
     }
 
+    /**
+     * {@inheritDoc}
+     */
+    public function getPath()
+    {
+        return $this->parameters['name'];
+    }
 }

+ 8 - 0
src/Symfony/Component/Templating/TemplateReferenceInterface.php

@@ -55,4 +55,12 @@ interface TemplateReferenceInterface
      */
     function getSignature();
 
+    /**
+     * Returns the path to the template.
+     *
+     * By default, it just returns the template name.
+     *
+     * @return string A path to the template or a resource
+     */
+    function getPath();
 }