[ Index ]

PHP Cross Reference of phpBB-3.3.14-deutsch

title

Body

[close]

/phpbb/template/twig/tokenparser/ -> event.php (source)

   1  <?php
   2  /**
   3  *
   4  * This file is part of the phpBB Forum Software package.
   5  *
   6  * @copyright (c) phpBB Limited <https://www.phpbb.com>
   7  * @license GNU General Public License, version 2 (GPL-2.0)
   8  *
   9  * For full copyright and license information, please see
  10  * the docs/CREDITS.txt file.
  11  *
  12  */
  13  
  14  namespace phpbb\template\twig\tokenparser;
  15  
  16  class event extends \Twig\TokenParser\AbstractTokenParser
  17  {
  18      /** @var \phpbb\template\twig\environment */
  19      protected $environment;
  20  
  21      /**
  22      * Constructor
  23      *
  24      * @param \phpbb\template\twig\environment $environment
  25      */
  26  	public function __construct(\phpbb\template\twig\environment $environment)
  27      {
  28          $this->environment = $environment;
  29      }
  30  
  31      /**
  32      * Parses a token and returns a node.
  33      *
  34      * @param \Twig\Token $token A Twig\Token instance
  35      *
  36      * @return \Twig\Node\Node A Twig\Node instance
  37      */
  38  	public function parse(\Twig\Token $token)
  39      {
  40          $expr = $this->parser->getExpressionParser()->parseExpression();
  41  
  42          $stream = $this->parser->getStream();
  43          $stream->expect(\Twig\Token::BLOCK_END_TYPE);
  44  
  45          return new \phpbb\template\twig\node\event($expr, $this->environment, $token->getLine(), $this->getTag());
  46      }
  47  
  48      /**
  49      * Gets the tag name associated with this token parser.
  50      *
  51      * @return string The tag name
  52      */
  53  	public function getTag()
  54      {
  55          return 'EVENT';
  56      }
  57  }


Generated: Mon Nov 25 19:05:08 2024 Cross-referenced by PHPXref 0.7.1