Interface Twig_NodeVisitorInterface

Implemented byTwig_BaseNodeVisitor, Twig_NodeVisitor_Escaper, Twig_NodeVisitor_Optimizer, Twig_NodeVisitor_SafeAnalysis, Twig_NodeVisitor_Sandbox, Twig_Profiler_NodeVisitor_Profiler

Twig_NodeVisitorInterface is the interface the all node visitor classes must implement.

Public Methods

Hide inherited methods

MethodDescriptionDefined By
enterNode() Called before child nodes are visited. Twig_NodeVisitorInterface
getPriority() Returns the priority for this visitor. Twig_NodeVisitorInterface
leaveNode() Called after child nodes are visited. Twig_NodeVisitorInterface

Method Details

enterNode() public abstract method

Called before child nodes are visited.

public abstract Twig_NodeInterface enterNode ( Twig_NodeInterface $node, Twig_Environment $env )
$node Twig_NodeInterface

The node to visit

$env Twig_Environment

The Twig environment instance

return Twig_NodeInterface

The modified node

getPriority() public abstract method

Returns the priority for this visitor.

Priority should be between -10 and 10 (0 is the default).

public abstract int getPriority ( )
return int

The priority level

leaveNode() public abstract method

Called after child nodes are visited.

public abstract Twig_NodeInterface|false leaveNode ( Twig_NodeInterface $node, Twig_Environment $env )
$node Twig_NodeInterface

The node to visit

$env Twig_Environment

The Twig environment instance

return Twig_NodeInterface|false

The modified node or false if the node must be removed