[ Index ] |
PHP Cross Reference of phpBB-3.3.14-deutsch |
[Summary view] [Print] [Text view]
1 <?php 2 3 /* 4 * This file is part of Twig. 5 * 6 * (c) Fabien Potencier 7 * 8 * For the full copyright and license information, please view the LICENSE 9 * file that was distributed with this source code. 10 */ 11 12 namespace Twig\TokenParser; 13 14 use Twig\Node\Expression\AssignNameExpression; 15 use Twig\Node\ImportNode; 16 use Twig\Token; 17 18 /** 19 * Imports macros. 20 * 21 * {% import 'forms.html' as forms %} 22 */ 23 final class ImportTokenParser extends AbstractTokenParser 24 { 25 public function parse(Token $token) 26 { 27 $macro = $this->parser->getExpressionParser()->parseExpression(); 28 $this->parser->getStream()->expect(/* Token::NAME_TYPE */ 5, 'as'); 29 $var = new AssignNameExpression($this->parser->getStream()->expect(/* Token::NAME_TYPE */ 5)->getValue(), $token->getLine()); 30 $this->parser->getStream()->expect(/* Token::BLOCK_END_TYPE */ 3); 31 32 $this->parser->addImportedSymbol('template', $var->getAttribute('name')); 33 34 return new ImportNode($macro, $var, $token->getLine(), $this->getTag(), $this->parser->isMainScope()); 35 } 36 37 public function getTag() 38 { 39 return 'import'; 40 } 41 } 42 43 class_alias('Twig\TokenParser\ImportTokenParser', 'Twig_TokenParser_Import');
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Mon Nov 25 19:05:08 2024 | Cross-referenced by PHPXref 0.7.1 |