|
|
@ -146,8 +146,10 @@ 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) { |
|
|
|
|
|
|
|
if (is_dir($path)) { |
|
|
|
$loader->addPath($path, substr($alias, 1)); |
|
|
|
$loader->addPath($path, substr($alias, 1)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
$this->twig->setLoader($loader); |
|
|
|
$this->twig->setLoader($loader); |
|
|
|
|
|
|
|
|
|
|
|
return $this->twig->render(pathinfo($file, PATHINFO_BASENAME), $params); |
|
|
|
return $this->twig->render(pathinfo($file, PATHINFO_BASENAME), $params); |
|
|
|