Reputation: 131
I'm running the latest version of Timber (0.22.5).
Is there a way that I can enable strict_variables
for Twig?
Upvotes: 2
Views: 335
Reputation: 131
Figured it out – stick this in your functions.php
file:
function theme_configure_twig($twig) {
$twig->enableStrictVariables();
return $twig;
}
add_filter('get_twig', 'theme_configure_twig');
Note that in the above, $twig
refers to Timber's instance of Twig_Environment
.
Upvotes: 1