From 7efddcef5411c4dd386f9dbcb3c117a15093a36f Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 7 Oct 2021 20:08:31 +0200 Subject: [PATCH] [ticket/13508] Add include_js twig tag as replacement for INCLUDEJS PHPBB3-13508 --- phpBB/phpbb/template/twig/extension.php | 1 + .../template/twig/tokenparser/include_js.php | 32 +++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 phpBB/phpbb/template/twig/tokenparser/include_js.php diff --git a/phpBB/phpbb/template/twig/extension.php b/phpBB/phpbb/template/twig/extension.php index 968a9c9d3e..6bce7c791f 100644 --- a/phpBB/phpbb/template/twig/extension.php +++ b/phpBB/phpbb/template/twig/extension.php @@ -60,6 +60,7 @@ class extension extends \Twig\Extension\AbstractExtension return array( new \phpbb\template\twig\tokenparser\defineparser, new \phpbb\template\twig\tokenparser\includeparser, + new \phpbb\template\twig\tokenparser\include_js, new \phpbb\template\twig\tokenparser\includejs, new \phpbb\template\twig\tokenparser\includecss, new \phpbb\template\twig\tokenparser\event($this->environment), diff --git a/phpBB/phpbb/template/twig/tokenparser/include_js.php b/phpBB/phpbb/template/twig/tokenparser/include_js.php new file mode 100644 index 0000000000..861ed1d209 --- /dev/null +++ b/phpBB/phpbb/template/twig/tokenparser/include_js.php @@ -0,0 +1,32 @@ + +* @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; + +use Twig\Error\SyntaxError; +use Twig\Node\Node; +use Twig\Token; +use Twig\TokenParser\AbstractTokenParser; + +class include_js extends includejs +{ + /** + * Gets the tag name associated with this token parser. + * + * @return string The tag name + */ + public function getTag(): string + { + return 'include_js'; + } +}