Преглед на файлове

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

Fabien Potencier преди 14 години
родител
ревизия
e8144e473e
променени са 2 файла, в които са добавени 15 реда и са изтрити 0 реда
  1. 7 0
      src/Symfony/Component/Templating/TemplateReference.php
  2. 8 0
      src/Symfony/Component/Templating/TemplateReferenceInterface.php

+ 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();
 }