Documentation

Twig_NodeVisitor_Optimizer extends OptimizerNodeVisitor
in package

Tries to optimize the AST.

Tags
deprecated

since Twig 2.7, use "Twig\NodeVisitor\OptimizerNodeVisitor" instead

Table of Contents

OPTIMIZE_ALL  = -1
OPTIMIZE_FOR  = 2
OPTIMIZE_NONE  = 0
OPTIMIZE_RAW_FILTER  = 4
OPTIMIZE_VAR_ACCESS  = 8
$loops  : mixed
$loopsTargets  : mixed
$optimizers  : mixed
__construct()  : mixed
enterNode()  : Node
Called before child nodes are visited.
getPriority()  : mixed
leaveNode()  : Node|null
Called after child nodes are visited.
doEnterNode()  : Node
Called before child nodes are visited.
doLeaveNode()  : Node|null
Called after child nodes are visited.
addLoopToAll()  : mixed
addLoopToCurrent()  : mixed
enterOptimizeFor()  : mixed
Optimizes "for" tag by removing the "loop" variable creation whenever possible.
leaveOptimizeFor()  : mixed
Optimizes "for" tag by removing the "loop" variable creation whenever possible.
optimizePrintNode()  : Node
Optimizes print nodes.
optimizeRawFilter()  : Node
Removes "raw" filters.

Constants

Properties

Methods

__construct()

public __construct([int $optimizers = -1 ]) : mixed
Parameters
$optimizers : int = -1

The optimizer mode

Return values
mixed

Search results