Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ParentExpression.php

class ParentExpression

Represents a parent node.

@author Fabien Potencier <fabien@symfony.com>

Hierarchy

  • class \Twig\Node\Node implements \Twig\Node\Countable, \Twig\Node\IteratorAggregate
    • class \Twig\Node\Expression\AbstractExpression extends \Twig\Node\Node
      • class \Twig\Node\Expression\ParentExpression extends \Twig\Node\Expression\AbstractExpression

Expanded class hierarchy of ParentExpression

3 files declare their use of ParentExpression
CoreExtension.php in vendor/twig/twig/src/Extension/CoreExtension.php
OptimizerNodeVisitor.php in vendor/twig/twig/src/NodeVisitor/OptimizerNodeVisitor.php
SafeAnalysisNodeVisitor.php in vendor/twig/twig/src/NodeVisitor/SafeAnalysisNodeVisitor.php

File

vendor/twig/twig/src/Node/Expression/ParentExpression.php, line 22

Namespace

Twig\Node\Expression
View source
class ParentExpression extends AbstractExpression {
    public function __construct(string $name, int $lineno) {
        parent::__construct([], [
            'output' => false,
            'name' => $name,
        ], $lineno);
    }
    public function compile(Compiler $compiler) : void {
        if ($this->getAttribute('output')) {
            $compiler->addDebugInfo($this)
                ->write('yield from $this->yieldParentBlock(')
                ->string($this->getAttribute('name'))
                ->raw(", \$context, \$blocks);\n");
        }
        else {
            $compiler->raw('$this->renderParentBlock(')
                ->string($this->getAttribute('name'))
                ->raw(', $context, $blocks)');
        }
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title Overrides
AbstractExpression::hasExplicitParentheses public function
AbstractExpression::isGenerator public function
AbstractExpression::setExplicitParentheses public function
Node::$attributeNameDeprecations private property @var array&lt;string, NameDeprecation&gt;
Node::$attributes protected property
Node::$lineno protected property
Node::$nodeNameDeprecations private property @var array&lt;string, NameDeprecation&gt;
Node::$nodes protected property
Node::$sourceContext private property
Node::$tag protected property
Node::count public function
Node::deprecateAttribute public function
Node::deprecateNode public function
Node::getAttribute public function
Node::getIterator public function
Node::getNode public function
Node::getNodeTag public function
Node::getSourceContext public function
Node::getTemplateLine public function
Node::getTemplateName public function
Node::hasAttribute public function
Node::hasNode public function
Node::removeAttribute public function
Node::removeNode public function
Node::setAttribute public function
Node::setNode public function 1
Node::setNodeTag public function @internal
Node::setSourceContext public function
Node::__toString public function
ParentExpression::compile public function Overrides Node::compile
ParentExpression::__construct public function Overrides Node::__construct
RSS feed
Powered by Drupal