You are here

public function Twig_NodeVisitor_Sandbox::leaveNode in Translation template extractor 6.3

Called after child nodes are visited.

Parameters

Twig_NodeInterface $node The node to visit:

Twig_Environment $env The Twig environment instance:

Return value

Twig_NodeInterface The modified node

Overrides Twig_NodeVisitorInterface::leaveNode

File

vendor/Twig/NodeVisitor/Sandbox.php, line 74

Class

Twig_NodeVisitor_Sandbox
Twig_NodeVisitor_Sandbox implements sandboxing.

Code

public function leaveNode(Twig_NodeInterface $node, Twig_Environment $env) {
  if ($node instanceof Twig_Node_Module) {
    $this->inAModule = false;
    return new Twig_Node_SandboxedModule($node, $this->filters, $this->tags, $this->functions);
  }
  return $node;
}