Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

sfTwigView now passes an array of dirs to the Twig_Loader so it is po…

…ssible to use extends and include in the same namespace as the template that is getting rendered.
  • Loading branch information...
commit e3d7f34d28702352ae4889344bd6eca799133b37 1 parent 57dbcaf
Henrik Bjørnskov authored
Showing with 5 additions and 3 deletions.
  1. +1 −1  lib/vendor/twig
  2. +4 −2 lib/view/sfTwigView.class.php
2  lib/vendor/twig
@@ -1 +1 @@
-Subproject commit 1ccdb19a8537c4edf60d4b40c6564121c02c904a
+Subproject commit 561dea5f8a62480d40a0b5313b137ce94efa51e8
View
6 lib/view/sfTwigView.class.php
@@ -36,9 +36,11 @@ public function initialize($context, $moduleName, $actionName, $viewName)
{
parent::initialize($context, $moduleName, $actionName, $viewName);
+ $config = $context->getConfiguration();
+
//sets up a Twig_Loader_Array with directories
- $this->twig_loaders['decorator'] = new Twig_Loader_FileSystem($this->getDecoratorDirectory(), sfConfig::get('sf_template_cache_dir'));
- $this->twig_loaders['module'] = new Twig_Loader_FileSystem($this->getDirectory(), sfConfig::get('sf_template_cache_dir'));
+ $this->twig_loaders['decorator'] = new Twig_Loader_FileSystem($config->getDecoratorDirs(), sfConfig::get('sf_template_cache_dir'));
+ $this->twig_loaders['module'] = new Twig_Loader_FileSystem($config->getTemplateDirs($this->getModuleName()), sfConfig::get('sf_template_cache_dir'));
//Setting the $loader to null lets us swap the loader out as we need it on the same instance.
$this->twig = new Twig_Environment(null);
Please sign in to comment.
Something went wrong with that request. Please try again.