Skip to content

Commit

Permalink
[Templating] fixed CacheLoader
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Feb 2, 2010
1 parent 287fa45 commit 8427af6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/Symfony/Components/Templating/Loader/CacheLoader.php
Expand Up @@ -78,11 +78,13 @@ public function load($template, array $options = array())
return new FileStorage($path, $options['renderer']);
}

if (false === $content = $this->loader->load($template, $options))
if (false === $storage = $this->loader->load($template, $options))
{
return false;
}

$content = $storage->getContent();

if ($this->loader instanceof CompilableLoaderInterface)
{
$content = $this->loader->compile($content);
Expand Down
Expand Up @@ -16,6 +16,7 @@
use Symfony\Components\Templating\Loader\Loader;
use Symfony\Components\Templating\Loader\CacheLoader;
use Symfony\Components\Templating\Loader\CompilableLoaderInterface;
use Symfony\Components\Templating\Storage\StringStorage;

$t = new LimeTest(9);

Expand Down Expand Up @@ -48,7 +49,7 @@ public function load($template, array $options = array())
{
if (method_exists($this, $method = 'get'.ucfirst($template).'Template'))
{
return $this->$method();
return new StringStorage($this->$method());
}

return false;
Expand Down

0 comments on commit 8427af6

Please sign in to comment.