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 |
FormThemeTokenParser.php
01 <?php
02
03 /*
04 * This file is part of the Symfony package.
05 *
06 * (c) Fabien Potencier <fabien@symfony.com>
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 Symfony\Bridge\Twig\TokenParser;
13
14 use Symfony\Bridge\Twig\Node\FormThemeNode;
15 use Twig\Node\Expression\ArrayExpression;
16 use Twig\Node\Node;
17 use Twig\Token;
18 use Twig\TokenParser\AbstractTokenParser;
19
20 /**
21 * Token Parser for the 'form_theme' tag.
22 *
23 * @author Fabien Potencier <fabien@symfony.com>
24 */
25 class FormThemeTokenParser extends AbstractTokenParser
26 {
27 /**
28 * Parses a token and returns a node.
29 *
30 * @return Node
31 */
32 public function parse(Token $token)
33 {
34 $lineno = $token->getLine();
35 $stream = $this->parser->getStream();
36
37 $form = $this->parser->getExpressionParser()->parseExpression();
38 $only = false;
39
40 if ($this->parser->getStream()->test(Token::NAME_TYPE, 'with')) {
41 $this->parser->getStream()->next();
42 $resources = $this->parser->getExpressionParser()->parseExpression();
43
44 if ($this->parser->getStream()->nextIf(Token::NAME_TYPE, 'only')) {
45 $only = true;
46 }
47 } else {
48 $resources = new ArrayExpression([], $stream->getCurrent()->getLine());
49 do {
50 $resources->addElement($this->parser->getExpressionParser()->parseExpression());
51 } while (!$stream->test(Token::BLOCK_END_TYPE));
52 }
53
54 $stream->expect(Token::BLOCK_END_TYPE);
55
56 return new FormThemeNode($form, $resources, $lineno, $this->getTag(), $only);
57 }
58
59 /**
60 * Gets the tag name associated with this token parser.
61 *
62 * @return string The tag name
63 */
64 public function getTag()
65 {
66 return 'form_theme';
67 }
68 }
69