Abstract Class Twig_BaseNodeVisitor

InheritanceTwig_BaseNodeVisitor
ImplementsTwig_NodeVisitorInterface
SubclassesTwig_NodeVisitor_Escaper, Twig_NodeVisitor_Optimizer, Twig_NodeVisitor_SafeAnalysis, Twig_NodeVisitor_Sandbox, Twig_Profiler_NodeVisitor_Profiler

Twig_BaseNodeVisitor can be used to make node visitors compatible with Twig 1.x and 2.x.

Public Methods

Hide inherited methods

MethodDescriptionDefined By
enterNode() {@inheritdoc} Twig_BaseNodeVisitor
getPriority() Returns the priority for this visitor. Twig_NodeVisitorInterface
leaveNode() {@inheritdoc} Twig_BaseNodeVisitor

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
doEnterNode() Called before child nodes are visited. Twig_BaseNodeVisitor
doLeaveNode() Called after child nodes are visited. Twig_BaseNodeVisitor

Method Details

doEnterNode() protected abstract method

Called before child nodes are visited.

protected abstract Twig_Node doEnterNode ( Twig_Node $node, Twig_Environment $env )
$node Twig_Node

The node to visit

$env Twig_Environment

The Twig environment instance

return Twig_Node

The modified node

doLeaveNode() protected abstract method

Called after child nodes are visited.

protected abstract Twig_Node|false doLeaveNode ( Twig_Node $node, Twig_Environment $env )
$node Twig_Node

The node to visit

$env Twig_Environment

The Twig environment instance

return Twig_Node|false

The modified node or false if the node must be removed

enterNode() public method

{@inheritdoc}

public void enterNode ( Twig_NodeInterface $node, Twig_Environment $env )
$node
$env
leaveNode() public method

{@inheritdoc}

public void leaveNode ( Twig_NodeInterface $node, Twig_Environment $env )
$node
$env