[ Index ]

PHP Cross Reference of phpBB-3.2.8-deutsch

title

Body

[close]

/phpbb/template/twig/tokenparser/ -> php.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 php extends \Twig_TokenParser
  17  {
  18      /**
  19      * Parses a token and returns a node.
  20      *
  21      * @param \Twig_Token $token A Twig_Token instance
  22      *
  23      * @return \Twig_NodeInterface A Twig_NodeInterface instance
  24      */
  25  	public function parse(\Twig_Token $token)
  26      {
  27          $stream = $this->parser->getStream();
  28  
  29          $stream->expect(\Twig_Token::BLOCK_END_TYPE);
  30  
  31          $body = $this->parser->subparse(array($this, 'decideEnd'), true);
  32  
  33          $stream->expect(\Twig_Token::BLOCK_END_TYPE);
  34  
  35          return new \phpbb\template\twig\node\php($body, $this->parser->getEnvironment(), $token->getLine(), $this->getTag());
  36      }
  37  
  38  	public function decideEnd(\Twig_Token $token)
  39      {
  40          return $token->test('ENDPHP');
  41      }
  42  
  43      /**
  44      * Gets the tag name associated with this token parser.
  45      *
  46      * @return string The tag name
  47      */
  48  	public function getTag()
  49      {
  50          return 'PHP';
  51      }
  52  }


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