我正在运行最新版本的Timber (0.22.5)。
有什么方法可以为Twig启用strict_variables吗?
发布于 2016-02-20 10:54:28
想出办法-把这个放在你的functions.php文件中:
function theme_configure_twig($twig) {
$twig->enableStrictVariables();
return $twig;
}
add_filter('get_twig', 'theme_configure_twig');注意,在上面,$twig引用了Timber的Twig_Environment实例。
https://stackoverflow.com/questions/35521731
复制相似问题