mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
Add cache to twig templates
This commit is contained in:
@@ -22,6 +22,10 @@ class TwigHelper
|
||||
$oLoader = new Twig_Loader_Filesystem($sViewPath);
|
||||
$oTwig = new Twig_Environment($oLoader);
|
||||
Extension::RegisterTwigExtensions($oTwig);
|
||||
$sLocalPath = utils::LocalPath($sViewPath);
|
||||
$sLocalPath = str_replace('env-'.utils::GetCurrentEnvironment(), 'twig', $sLocalPath);
|
||||
$sCachePath = utils::GetCachePath().$sLocalPath;
|
||||
$oTwig->setCache($sCachePath);
|
||||
|
||||
return $oTwig;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user