소스 검색

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