AbstractNodeVisitor
in package
implements
NodeVisitorInterface
Used to make node visitors compatible with Twig 1.x and 2.x.
To be removed in Twig 3.1.
Tags
Interfaces, Classes and Traits
- NodeVisitorInterface
- Interface for node visitor classes.
Table of Contents
- enterNode() : Node
- Called before child nodes are visited.
- leaveNode() : Node|null
- Called after child nodes are visited.
- doEnterNode() : Node
- Called before child nodes are visited.
- doLeaveNode() : Node|null
- Called after child nodes are visited.
Methods
enterNode()
Called before child nodes are visited.
public
final enterNode(Node $node, Environment $env) : Node
Parameters
- $node : Node
- $env : Environment
Return values
Node —The modified node
leaveNode()
Called after child nodes are visited.
public
final leaveNode(Node $node, Environment $env) : Node|null
Parameters
- $node : Node
- $env : Environment
Return values
Node|null —The modified node or null if the node must be removed
doEnterNode()
Called before child nodes are visited.
protected
abstract doEnterNode(Node $node, Environment $env) : Node
Parameters
- $node : Node
- $env : Environment
Return values
Node —The modified node
doLeaveNode()
Called after child nodes are visited.
protected
abstract doLeaveNode(Node $node, Environment $env) : Node|null
Parameters
- $node : Node
- $env : Environment
Return values
Node|null —The modified node or null if the node must be removed