diff --git a/phpBB/phpbb/template/twig/extension.php b/phpBB/phpbb/template/twig/extension.php index 6bce7c791f..4b4771c8aa 100644 --- a/phpBB/phpbb/template/twig/extension.php +++ b/phpBB/phpbb/template/twig/extension.php @@ -62,6 +62,7 @@ class extension extends \Twig\Extension\AbstractExtension new \phpbb\template\twig\tokenparser\includeparser, new \phpbb\template\twig\tokenparser\include_js, new \phpbb\template\twig\tokenparser\includejs, + new \phpbb\template\twig\tokenparser\include_css, new \phpbb\template\twig\tokenparser\includecss, new \phpbb\template\twig\tokenparser\event($this->environment), new \phpbb\template\twig\tokenparser\includephp($this->environment), diff --git a/phpBB/phpbb/template/twig/tokenparser/include_css.php b/phpBB/phpbb/template/twig/tokenparser/include_css.php new file mode 100644 index 0000000000..353fb26c9c --- /dev/null +++ b/phpBB/phpbb/template/twig/tokenparser/include_css.php @@ -0,0 +1,27 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\template\twig\tokenparser; + +class include_css extends includecss +{ + /** + * Gets the tag name associated with this token parser. + * + * @return string The tag name + */ + public function getTag(): string + { + return 'include_css'; + } +} diff --git a/phpBB/phpbb/template/twig/tokenparser/include_js.php b/phpBB/phpbb/template/twig/tokenparser/include_js.php index 861ed1d209..5b57fb4d6f 100644 --- a/phpBB/phpbb/template/twig/tokenparser/include_js.php +++ b/phpBB/phpbb/template/twig/tokenparser/include_js.php @@ -13,11 +13,6 @@ namespace phpbb\template\twig\tokenparser; -use Twig\Error\SyntaxError; -use Twig\Node\Node; -use Twig\Token; -use Twig\TokenParser\AbstractTokenParser; - class include_js extends includejs { /** diff --git a/tests/template/templates/include_css.html b/tests/template/templates/include_css.html new file mode 100644 index 0000000000..23e3c426d7 --- /dev/null +++ b/tests/template/templates/include_css.html @@ -0,0 +1,10 @@ + + + + + + + + + +{$STYLESHEETS} diff --git a/tests/template/templates/include_js.html b/tests/template/templates/include_js.html new file mode 100644 index 0000000000..0bcdf1a815 --- /dev/null +++ b/tests/template/templates/include_js.html @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +{$SCRIPTS}