aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/template
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/template')
-rw-r--r--phpBB/includes/template/twig/definition.php19
-rw-r--r--phpBB/includes/template/twig/node/includejs.php4
2 files changed, 21 insertions, 2 deletions
diff --git a/phpBB/includes/template/twig/definition.php b/phpBB/includes/template/twig/definition.php
index 110437eb32..6557b209eb 100644
--- a/phpBB/includes/template/twig/definition.php
+++ b/phpBB/includes/template/twig/definition.php
@@ -47,4 +47,23 @@ class phpbb_template_twig_definition
return $this;
}
+
+ /**
+ * Append to a variable
+ *
+ * @param string $name
+ * @param string $value
+ * @return phpbb_template_twig_definition
+ */
+ public function append($name, $value)
+ {
+ if (!isset($this->definitions[$name]))
+ {
+ $this->definitions[$name] = '';
+ }
+
+ $this->definitions[$name] .= $value;
+
+ return $this;
+ }
}
diff --git a/phpBB/includes/template/twig/node/includejs.php b/phpBB/includes/template/twig/node/includejs.php
index f4c26affa4..bba5d4ef91 100644
--- a/phpBB/includes/template/twig/node/includejs.php
+++ b/phpBB/includes/template/twig/node/includejs.php
@@ -31,9 +31,9 @@ class phpbb_template_twig_node_includejs extends Twig_Node
$config = $this->environment->get_phpbb_config();
$compiler
- ->write("\$context['SCRIPTS'] .= '<script type=\"text/javascript\" src=\"' . ")
+ ->write("\$context['definition']->append('SCRIPTS', '<script type=\"text/javascript\" src=\"' . ")
->subcompile($this->getNode('expr'))
- ->raw(" . '?assets_version=" . $config['assets_version'] . "\"></script>';\n\n")
+ ->raw(" . '?assets_version=" . $config['assets_version'] . "\"></script>');\n")
;
}
}