You are here

protected function Twig_NodeVisitor_Escaper::doLeaveNode in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/twig/twig/lib/Twig/NodeVisitor/Escaper.php \Twig_NodeVisitor_Escaper::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/Escaper.php, line 55

Class

Twig_NodeVisitor_Escaper
Twig_NodeVisitor_Escaper implements output escaping.

Code

protected function doLeaveNode(Twig_Node $node, Twig_Environment $env) {
  if ($node instanceof Twig_Node_Module) {
    $this->defaultStrategy = false;
    $this->safeVars = array();
  }
  elseif ($node instanceof Twig_Node_Expression_Filter) {
    return $this
      ->preEscapeFilterNode($node, $env);
  }
  elseif ($node instanceof Twig_Node_Print) {
    return $this
      ->escapePrintNode($node, $env, $this
      ->needEscaping($env));
  }
  if ($node instanceof Twig_Node_AutoEscape || $node instanceof Twig_Node_Block) {
    array_pop($this->statusStack);
  }
  elseif ($node instanceof Twig_Node_BlockReference) {
    $this->blocks[$node
      ->getAttribute('name')] = $this
      ->needEscaping($env);
  }
  return $node;
}