Verzeichnisstruktur phpBB-3.3.15
- Veröffentlicht
- 28.08.2024
So funktioniert es
|
Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück |
Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis. |
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
ImportTokenParser.php
01 <?php
02
03 /*
04 * This file is part of Twig.
05 *
06 * (c) Fabien Potencier
07 *
08 * For the full copyright and license information, please view the LICENSE
09 * 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');
44