public function Twig_NodeVisitor_Escaper::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/ Escaper.php, line 65
Class
- Twig_NodeVisitor_Escaper
- Twig_NodeVisitor_Escaper implements output escaping.
Code
public function leaveNode(Twig_NodeInterface $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;
}