这是一个视图,使用twig格式,并且我将其注入到Slim容器中:
// Views and Templates
// https://www.slimframework.com/docs/features/templates.html
$container['view'] = function ($container) {
$settings = $container->get('settings');
$loader = new Twig_Loader_Filesystem('templates');
$twig = new Twig_Environment($loader, array(
'cache' => 'cache',
));
// Add twig extension.
$twig->addExtension(new \Twig_Extensions_Extension_Array());
return $twig;
};
使用此设置,Twig 会始终从缓存中读取模板。我能否在开发期间关闭缓存?