Skip to content

Commit a4c538d

Browse files
committed
Added a help note about the limitations of the getTemplateRelativePath() method
1 parent d3f456d commit a4c538d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/AppBundle/Twig/SourceCodeExtension.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,14 @@ private function getTemplateCode()
9393
return $this->loader->getSource($this->template->getTemplateName());
9494
}
9595

96+
/**
97+
* The logic implemented in this method is solely developed for the Symfony
98+
* Demo application and cannot be used as a general purpose solution.
99+
* Specifically, this logic won't work for templates that use a namespaced path
100+
* (e.g. @WebProfiler/Collector/time.html.twig) or any loader different from
101+
* Twig_Loader_Filesystem (e.g. TwigBundle:Exception:exception.txt.twig notation
102+
* or an anonymous template created by the {% embed %} tag).
103+
*/
96104
private function getTemplateRelativePath()
97105
{
98106
return 'app/Resources/views/'.$this->template->getTemplateName();

0 commit comments

Comments
 (0)