mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 21:40:43 +02:00
[ticket/11649] Expose Twig through the container
PHPBB3-11649
This commit is contained in:
@@ -147,7 +147,28 @@ Zeta test event in all',
|
||||
$phpbb_root_path,
|
||||
$phpEx
|
||||
);
|
||||
$this->template = new \phpbb\template\twig\twig($path_helper, $config, $user, new \phpbb\template\context, $this->extension_manager);
|
||||
|
||||
$container = new phpbb_mock_container_builder();
|
||||
$cache_path = $phpbb_root_path . 'cache/twig';
|
||||
$context = new \phpbb\template\context();
|
||||
$loader = new \phpbb\template\twig\loader('');
|
||||
$twig = new \phpbb\template\twig\environment(
|
||||
$config,
|
||||
$path_helper,
|
||||
$container,
|
||||
$cache_path,
|
||||
$this->extension_manager,
|
||||
$loader,
|
||||
array(
|
||||
'cache' => false,
|
||||
'debug' => false,
|
||||
'auto_reload' => true,
|
||||
'autoescape' => false,
|
||||
)
|
||||
);
|
||||
$this->template = new \phpbb\template\twig\twig($path_helper, $config, $user, $context, $twig, $cache_path, array(new \phpbb\template\twig\extension($context, $this->user)), $this->extension_manager);
|
||||
$container->set('template.twig.lexer', new \phpbb\template\twig\lexer($twig));
|
||||
|
||||
$this->template->set_custom_style(((!empty($style_names)) ? $style_names : 'silver'), array($this->template_path));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user