Commit b44a9007 by Alexander Makarov

Fixes Twig to ignore non-path aliases instead of erroring

parent 41f31bcd
...@@ -146,7 +146,9 @@ class ViewRenderer extends BaseViewRenderer ...@@ -146,7 +146,9 @@ class ViewRenderer extends BaseViewRenderer
$loader = new \Twig_Loader_Filesystem(dirname($file)); $loader = new \Twig_Loader_Filesystem(dirname($file));
foreach (Yii::$aliases as $alias => $path) { foreach (Yii::$aliases as $alias => $path) {
$loader->addPath($path, substr($alias, 1)); if (is_dir($path)) {
$loader->addPath($path, substr($alias, 1));
}
} }
$this->twig->setLoader($loader); $this->twig->setLoader($loader);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment