[ Index ]

PHP Cross Reference of phpBB-3.2.8-deutsch

title

Body

[close]

/phpbb/template/twig/tokenparser/ -> includephp.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  * @copyright Portions (c) 2009 Fabien Potencier, Armin Ronacher
   8  * @license GNU General Public License, version 2 (GPL-2.0)
   9  *
  10  * For full copyright and license information, please see
  11  * the docs/CREDITS.txt file.
  12  *
  13  */
  14  
  15  namespace phpbb\template\twig\tokenparser;
  16  
  17  class includephp extends \Twig_TokenParser
  18  {
  19      /**
  20      * Parses a token and returns a node.
  21      *
  22      * @param \Twig_Token $token A Twig_Token instance
  23      *
  24      * @return \Twig_NodeInterface A Twig_NodeInterface instance
  25      */
  26  	public function parse(\Twig_Token $token)
  27      {
  28          $expr = $this->parser->getExpressionParser()->parseExpression();
  29  
  30          $stream = $this->parser->getStream();
  31  
  32          $ignoreMissing = false;
  33          if ($stream->test(\Twig_Token::NAME_TYPE, 'ignore'))
  34          {
  35              $stream->next();
  36              $stream->expect(\Twig_Token::NAME_TYPE, 'missing');
  37  
  38              $ignoreMissing = true;
  39          }
  40  
  41          $stream->expect(\Twig_Token::BLOCK_END_TYPE);
  42  
  43          return new \phpbb\template\twig\node\includephp($expr, $this->parser->getEnvironment(), $token->getLine(), $ignoreMissing, $this->getTag());
  44      }
  45  
  46      /**
  47      * Gets the tag name associated with this token parser.
  48      *
  49      * @return string The tag name
  50      */
  51  	public function getTag()
  52      {
  53          return 'INCLUDEPHP';
  54      }
  55  }


Generated: Tue Apr 7 19:42:26 2020 Cross-referenced by PHPXref 0.7.1