You are here

protected function Twig_NodeVisitor_Optimizer::addLoopToCurrent in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/twig/twig/lib/Twig/NodeVisitor/Optimizer.php \Twig_NodeVisitor_Optimizer::addLoopToCurrent()
1 call to Twig_NodeVisitor_Optimizer::addLoopToCurrent()
Twig_NodeVisitor_Optimizer::enterOptimizeFor in vendor/twig/twig/lib/Twig/NodeVisitor/Optimizer.php
Optimizes "for" tag by removing the "loop" variable creation whenever possible.

File

vendor/twig/twig/lib/Twig/NodeVisitor/Optimizer.php, line 252

Class

Twig_NodeVisitor_Optimizer
Twig_NodeVisitor_Optimizer tries to optimizes the AST.

Code

protected function addLoopToCurrent() {
  $this->loops[0]
    ->setAttribute('with_loop', true);
}