AbstractNodeVisitor

Implements\Twig\NodeVisitor\NodeVisitorInterface

Used to make node visitors compatible with Twig 1.x and 2.x.

To be removed in Twig 3.1.

author

Fabien Potencier fabien@symfony.com

package

Default

Methods

Called before child nodes are visited.

doEnterNode(\Twig\Node\Node $node,\Twig\Environment $env): \Twig\Node\Node
abstract

Arguments

$env

\Twig\Environment

Response

\Twig\Node\Node

The modified node

Called after child nodes are visited.

doLeaveNode(\Twig\Node\Node $node,\Twig\Environment $env): \Twig\Node\Node|false|null
abstract

Arguments

$env

\Twig\Environment

Response

\Twig\Node\Node|false|null

The modified node or null if the node must be removed

Called before child nodes are visited.

enterNode(\Twig_NodeInterface $node,\Twig\Environment $env): \Twig_NodeInterface
final

Arguments

$env

\Twig\Environment

Response

\Twig_NodeInterface

The modified node

Called after child nodes are visited.

leaveNode(\Twig_NodeInterface $node,\Twig\Environment $env): \Twig_NodeInterface|false|null
final

Arguments

$env

\Twig\Environment

Response

\Twig_NodeInterface|false|null

The modified node or null if the node must be removed