Skip to content

Instantly share code, notes, and snippets.

@rande
Created January 21, 2011 09:42
Show Gist options
  • Save rande/789474 to your computer and use it in GitHub Desktop.
Save rande/789474 to your computer and use it in GitHub Desktop.
diff --git a/src/Symfony/Bundle/FrameworkBundle/Routing/FileLocator.php b/src/Symfony/Bundle/FrameworkBundle/Routing/FileLocator
index 49b69f2..698e17d 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Routing/FileLocator.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Routing/FileLocator.php
@@ -42,7 +42,8 @@ class FileLocator extends BaseFileLocator
public function locate($file)
{
if ('@' === $file[0]) {
- return $this->kernel->locateResource($file);
+ $ressources = $this->kernel->locateResource($file, null, false);
+ return $ressources[0];
}
return parent::locate($file);
diff --git a/src/Symfony/Bundle/FrameworkBundle/Templating/Loader/TemplateLocator.php b/src/Symfony/Bundle/FrameworkBundle/Templ
index 5daa426..e3177ca 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Templating/Loader/TemplateLocator.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Templating/Loader/TemplateLocator.php
@@ -65,7 +65,9 @@ class TemplateLocator
}
try {
- return $this->kernel->locateResource('@'.$resource, $this->path);
+ $ressources = $this->kernel->locateResource('@'.$resource, $this->path, false);
+
+ return $ressources[0];
} catch (\Exception $e) {
throw new \InvalidArgumentException(sprintf('Unable to find template "%s".', $name, $this->path), 0, $e);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment