diff options
| author | Nathaniel Guse <nathaniel.guse@gmail.com> | 2013-06-24 22:37:58 -0500 |
|---|---|---|
| committer | Nathaniel Guse <nathaniel.guse@gmail.com> | 2013-06-24 22:37:58 -0500 |
| commit | 3ca99f8122c149a66f59dbf3c9884c095db7ad3c (patch) | |
| tree | 9c7d28a32673b39fb1af9dc4af1ee845f44d0fa8 /phpBB/includes/template/twig/node | |
| parent | 814d57d201d654ce0510ede5b43cfad6b06d372e (diff) | |
| download | forums-3ca99f8122c149a66f59dbf3c9884c095db7ad3c.tar forums-3ca99f8122c149a66f59dbf3c9884c095db7ad3c.tar.gz forums-3ca99f8122c149a66f59dbf3c9884c095db7ad3c.tar.bz2 forums-3ca99f8122c149a66f59dbf3c9884c095db7ad3c.tar.xz forums-3ca99f8122c149a66f59dbf3c9884c095db7ad3c.zip | |
[feature/twig] Append assets_version to includejs tag
Some fixes for main template parser
PHPBB3-11598
Diffstat (limited to 'phpBB/includes/template/twig/node')
| -rw-r--r-- | phpBB/includes/template/twig/node/event.php | 1 | ||||
| -rw-r--r-- | phpBB/includes/template/twig/node/includejs.php | 11 |
2 files changed, 10 insertions, 2 deletions
diff --git a/phpBB/includes/template/twig/node/event.php b/phpBB/includes/template/twig/node/event.php index 12e6ef1329..358c68dae5 100644 --- a/phpBB/includes/template/twig/node/event.php +++ b/phpBB/includes/template/twig/node/event.php @@ -9,6 +9,7 @@ class phpbb_template_twig_node_event extends Twig_Node { + /** @var Twig_Environment */ protected $environment; public function __construct(Twig_Node_Expression $expr, phpbb_template_twig_environment $environment, $lineno, $tag = null) diff --git a/phpBB/includes/template/twig/node/includejs.php b/phpBB/includes/template/twig/node/includejs.php index 881636a326..f4c26affa4 100644 --- a/phpBB/includes/template/twig/node/includejs.php +++ b/phpBB/includes/template/twig/node/includejs.php @@ -9,8 +9,13 @@ class phpbb_template_twig_node_includejs extends Twig_Node { - public function __construct(Twig_Node_Expression $expr, $lineno, $tag = null) + /** @var Twig_Environment */ + protected $environment; + + public function __construct(Twig_Node_Expression $expr, phpbb_template_twig_environment $environment, $lineno, $tag = null) { + $this->environment = $environment; + parent::__construct(array('expr' => $expr), array(), $lineno, $tag); } @@ -23,10 +28,12 @@ class phpbb_template_twig_node_includejs extends Twig_Node { $compiler->addDebugInfo($this); + $config = $this->environment->get_phpbb_config(); + $compiler ->write("\$context['SCRIPTS'] .= '<script type=\"text/javascript\" src=\"' . ") ->subcompile($this->getNode('expr')) - ->raw(" . '\">';\n\n") + ->raw(" . '?assets_version=" . $config['assets_version'] . "\"></script>';\n\n") ; } } |
