You are here

protected function Twig_NodeVisitor_Sandbox::doLeaveNode in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/twig/twig/lib/Twig/NodeVisitor/Sandbox.php \Twig_NodeVisitor_Sandbox::doLeaveNode()

Called after child nodes are visited.

Parameters

Twig_Node $node The node to visit:

Twig_Environment $env The Twig environment instance:

Return value

Twig_Node|false The modified node or false if the node must be removed

Overrides Twig_BaseNodeVisitor::doLeaveNode

File

vendor/twig/twig/lib/Twig/NodeVisitor/Sandbox.php, line 64

Class

Twig_NodeVisitor_Sandbox
Twig_NodeVisitor_Sandbox implements sandboxing.

Code

protected function doLeaveNode(Twig_Node $node, Twig_Environment $env) {
  if ($node instanceof Twig_Node_Module) {
    $this->inAModule = false;
    $node
      ->setNode('display_start', new Twig_Node(array(
      new Twig_Node_CheckSecurity($this->filters, $this->tags, $this->functions),
      $node
        ->getNode('display_start'),
    )));
  }
  return $node;
}