aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Darricau <tristan.darricau@sensiolabs.com>2016-02-02 21:18:09 +0100
committerTristan Darricau <tristan.darricau@sensiolabs.com>2016-02-02 21:18:09 +0100
commit724bd471a746d0fe2ef799091b943e671d21166e (patch)
tree2d621e239359b6d60e0ce80e124cdcdbb66ff3f3
parent4133d8a5f15451a00f2f1ed6a4154591ae7f908a (diff)
parent94f87d931854bf25fb051a27be9a1883510389c4 (diff)
downloadforums-724bd471a746d0fe2ef799091b943e671d21166e.tar
forums-724bd471a746d0fe2ef799091b943e671d21166e.tar.gz
forums-724bd471a746d0fe2ef799091b943e671d21166e.tar.bz2
forums-724bd471a746d0fe2ef799091b943e671d21166e.tar.xz
forums-724bd471a746d0fe2ef799091b943e671d21166e.zip
Merge pull request #4155 from marc1706/ticket/14446
[ticket/14446] Add predefined placeholder variables to twig definition * marc1706/ticket/14446: [ticket/14446] Add predefined placeholder variables to twig definition
-rw-r--r--phpBB/phpbb/template/twig/definition.php5
-rw-r--r--phpBB/phpbb/template/twig/node/includeasset.php2
2 files changed, 4 insertions, 3 deletions
diff --git a/phpBB/phpbb/template/twig/definition.php b/phpBB/phpbb/template/twig/definition.php
index cb3c953692..205f0e68ee 100644
--- a/phpBB/phpbb/template/twig/definition.php
+++ b/phpBB/phpbb/template/twig/definition.php
@@ -19,7 +19,10 @@ namespace phpbb\template\twig;
class definition
{
/** @var array **/
- protected $definitions = array();
+ protected $definitions = array(
+ 'SCRIPTS' => '__SCRIPTS_PLACEHOLDER__',
+ 'STYLESHEETS' => '__STYLESHEETS_PLACEHOLDER__'
+ );
/**
* Get a DEFINE'd variable
diff --git a/phpBB/phpbb/template/twig/node/includeasset.php b/phpBB/phpbb/template/twig/node/includeasset.php
index 3d3c6e4df8..6d50eafc9d 100644
--- a/phpBB/phpbb/template/twig/node/includeasset.php
+++ b/phpBB/phpbb/template/twig/node/includeasset.php
@@ -53,8 +53,6 @@ abstract class includeasset extends \Twig_Node
->write("\$asset->add_assets_version('{$config['assets_version']}');\n")
->outdent()
->write("}\n")
- ->write("\$context['definition']->set('STYLESHEETS', '__STYLESHEETS_PLACEHOLDER__');\n")
- ->write("\$context['definition']->set('SCRIPTS', '__SCRIPTS_PLACEHOLDER__');\n")
->write("\$this->getEnvironment()->get_assets_bag()->add_{$this->get_setters_name()}(\$asset);")
;
}