aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/template/twig/tokenparser
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/template/twig/tokenparser')
-rw-r--r--phpBB/includes/template/twig/tokenparser/event.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/phpBB/includes/template/twig/tokenparser/event.php b/phpBB/includes/template/twig/tokenparser/event.php
index cd211098d6..27a8350af1 100644
--- a/phpBB/includes/template/twig/tokenparser/event.php
+++ b/phpBB/includes/template/twig/tokenparser/event.php
@@ -21,6 +21,31 @@
*/
class phpbb_template_twig_tokenparser_event extends Twig_TokenParser_Include
{
+ protected function parseArguments()
+ {
+ $stream = $this->parser->getStream();
+
+ $ignoreMissing = true;
+
+ $variables = null;
+ if ($stream->test(Twig_Token::NAME_TYPE, 'with')) {
+ $stream->next();
+
+ $variables = $this->parser->getExpressionParser()->parseExpression();
+ }
+
+ $only = false;
+ if ($stream->test(Twig_Token::NAME_TYPE, 'only')) {
+ $stream->next();
+
+ $only = true;
+ }
+
+ $stream->expect(Twig_Token::BLOCK_END_TYPE);
+
+ return array($variables, $only, $ignoreMissing);
+ }
+
/**
* Gets the tag name associated with this token parser.
*