class PrintNode
Represents a node that outputs an expression.
@author Fabien Potencier <fabien@symfony.com>
Hierarchy
- class \Twig\Node\Node implements \Twig\Node\Countable, \Twig\Node\IteratorAggregate
- class \Twig\Node\PrintNode extends \Twig\Node\Node implements \Twig\Node\NodeOutputInterface
Expanded class hierarchy of PrintNode
10 files declare their use of PrintNode
- ApplyTokenParser.php in vendor/
twig/ twig/ src/ TokenParser/ ApplyTokenParser.php - BlockTokenParser.php in vendor/
twig/ twig/ src/ TokenParser/ BlockTokenParser.php - ComponentNodeVisitor.php in core/
lib/ Drupal/ Core/ Template/ ComponentNodeVisitor.php - EscaperNodeVisitor.php in vendor/
twig/ twig/ src/ NodeVisitor/ EscaperNodeVisitor.php - OptimizerNodeVisitor.php in vendor/
twig/ twig/ src/ NodeVisitor/ OptimizerNodeVisitor.php
File
-
vendor/
twig/ twig/ src/ Node/ PrintNode.php, line 24
Namespace
Twig\NodeView source
class PrintNode extends Node implements NodeOutputInterface {
public function __construct(AbstractExpression $expr, int $lineno) {
parent::__construct([
'expr' => $expr,
], [], $lineno);
}
public function compile(Compiler $compiler) : void {
/** @var AbstractExpression */
$expr = $this->getNode('expr');
$compiler->addDebugInfo($this)
->write($expr->isGenerator() ? 'yield from ' : 'yield ')
->subcompile($expr)
->raw(";\n");
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overriden Title | Overrides |
---|---|---|---|---|---|
Node::$attributeNameDeprecations | private | property | @var array<string, NameDeprecation> | ||
Node::$attributes | protected | property | |||
Node::$lineno | protected | property | |||
Node::$nodeNameDeprecations | private | property | @var array<string, NameDeprecation> | ||
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 | |||
PrintNode::compile | public | function | Overrides Node::compile | ||
PrintNode::__construct | public | function | Overrides Node::__construct |