1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-16 21:54:00 +02:00

[ticket/12632] Add twig.debug and twig.auto_reload in config.yml

PHPBB3-13206
PHPBB3-12632
This commit is contained in:
Tristan Darricau
2014-11-25 17:04:15 +01:00
committed by Tristan Darricau
parent 6be8841a57
commit f821130c3a
7 changed files with 42 additions and 1 deletions

View File

@@ -69,6 +69,20 @@ class core extends Extension
}
}
// Set the Twig options if defined in the environment
$definition = $container->getDefinition('template.twig.environment');
$twig_environment_options = $definition->getArgument(6);
if ($config['twig']['debug'])
{
$twig_environment_options['debug'] = true;
}
if ($config['twig']['auto_reload'])
{
$twig_environment_options['auto_reload'] = true;
}
// Replace the 6th argument, the options passed to the environment
$definition->replaceArgument(6, $twig_environment_options);
if ($config['twig']['enable_debug_extension'])
{
$definition = $container->getDefinition('template.twig.extensions.debug');