*/
abstract protected function getFixturesDir();
+ /**
+ * @return Twig_RuntimeLoaderInterface[]
+ */
+ protected function getRuntimeLoaders()
+ {
+ return array();
+ }
+
/**
* @return Twig_ExtensionInterface[]
*/
), $match[2] ? eval($match[2].';') : array());
$twig = new Twig_Environment($loader, $config);
$twig->addGlobal('global', 'global');
+ foreach ($this->getRuntimeLoaders() as $runtimeLoader) {
+ $twig->addRuntimeLoader($runtimeLoader);
+ }
+
foreach ($this->getExtensions() as $extension) {
$twig->addExtension($extension);
}