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
- class \Twig\Node\Expression\AbstractExpression extends \Twig\Node\Node
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\ExpressionView 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)');
}
}
}