1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-19 23:11:45 +02:00

[ticket/11649] Expose Twig through the container

PHPBB3-11649
This commit is contained in:
Tristan Darricau
2014-08-02 19:09:42 +02:00
parent 56ca276dcf
commit 192b8e2568
9 changed files with 192 additions and 47 deletions

View File

@@ -10,6 +10,7 @@ imports:
- { resource: mimetype_guessers.yml }
- { resource: passwords.yml }
- { resource: profilefields.yml }
- { resource: twig.yml }
services:
acl.permissions:
@@ -339,6 +340,9 @@ services:
- @config
- @user
- @template_context
- @template.twig.environment
- %core.template.cache_path%
- @template.twig.extensions.collection
- @ext.manager
template_context:

36
phpBB/config/twig.yml Normal file
View File

@@ -0,0 +1,36 @@
parameters:
core.template.cache_path: %core.root_path%cache/twig/
services:
template.twig.environment:
class: phpbb\template\twig\environment
arguments:
- @config
- @path_helper
- @service_container
- %core.template.cache_path%
- @ext.manager
- @template.twig.loader
template.twig.lexer:
class: phpbb\template\twig\lexer
arguments:
- @template.twig.environment
template.twig.loader:
class: phpbb\template\twig\loader
template.twig.extensions.collection:
class: phpbb\di\service_collection
arguments:
- @service_container
tags:
- { name: service_collection, tag: twig.extension }
template.twig.extensions.phpbb:
class: phpbb\template\twig\extension
arguments:
- @template_context
- @user
tags:
- { name: twig.extension }