Esempio n. 1
0
 /**
  * Provide Twig_Environment configured for rendering specific skin.
  *
  * @param SkinConfig $skin skin to use.
  *
  * @returns Twig_Environment
  */
 public function provideTwigForSkin(SkinConfig $skin)
 {
     $paths = $skin->getAllPaths();
     $loader = new Twig_Loader_Filesystem($paths);
     $twig = new Twig_Environment($loader, $this->twigOptions);
     foreach ($this->extensions as $extension) {
         $twig->addExtension($extension);
     }
     return $twig;
 }
Esempio n. 2
0
 public function setSkin(SkinConfig $skin)
 {
     $this->twig->setLoader(new Twig_Loader_Filesystem($skin->getAllPaths()));
 }