这是我在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总是从缓存中读取模板。有没有办法在开发期间关闭缓存?
发布于 2017-03-03 16:55:30
将“缓存”更改为“false”。像这样
$twig = new Twig_Environment($loader, array(
'cache' => false,
));https://stackoverflow.com/questions/42584433
复制相似问题