private function optimizer()
  {
    $optimizeOption = -1;

    if ($this->environment['cache'] === false) {
      $optimizeOption = 2;
    }

    switch ($optimizeOption) {
      case -1:
        $nodeVisitorOptimizer = Twig_NodeVisitor_Optimizer::OPTIMIZE_ALL;
        break;

      case 0:
        $nodeVisitorOptimizer = Twig_NodeVisitor_Optimizer::OPTIMIZE_NONE;
        break;

      case 2:
        $nodeVisitorOptimizer = Twig_NodeVisitor_Optimizer::OPTIMIZE_FOR;
        break;

      case 4:
        $nodeVisitorOptimizer = Twig_NodeVisitor_Optimizer::OPTIMIZE_RAW_FILTER;
        break;

      case 8:
        $nodeVisitorOptimizer = Twig_NodeVisitor_Optimizer::OPTIMIZE_VAR_ACCESS;
        break;

      default:
        $nodeVisitorOptimizer = Twig_NodeVisitor_Optimizer::OPTIMIZE_ALL;
        break;
    }

    $optimizer = new Twig_Extension_Optimizer($nodeVisitorOptimizer);
    $this->twig->addExtension($optimizer);
  }
private function optimizer()
  {
    $optimizeOption = -1;

    if ($this->environment['cache'] === false) {
      $optimizeOption = 2;
    }

    switch ($optimizeOption) {
      case -1:
        $nodeVisitorOptimizer = Twig_NodeVisitor_Optimizer::OPTIMIZE_ALL;
        break;

      case 0:
        $nodeVisitorOptimizer = Twig_NodeVisitor_Optimizer::OPTIMIZE_NONE;
        break;

      case 2:
        $nodeVisitorOptimizer = Twig_NodeVisitor_Optimizer::OPTIMIZE_FOR;
        break;

      case 4:
        $nodeVisitorOptimizer = Twig_NodeVisitor_Optimizer::OPTIMIZE_RAW_FILTER;
        break;

      case 8:
        $nodeVisitorOptimizer = Twig_NodeVisitor_Optimizer::OPTIMIZE_VAR_ACCESS;
        break;

      default:
        $nodeVisitorOptimizer = Twig_NodeVisitor_Optimizer::OPTIMIZE_ALL;
        break;
    }

    $optimizer = new Twig_Extension_Optimizer($nodeVisitorOptimizer);
    $this->twig->addExtension($optimizer);
  }
private function optimizer ( ) { $ optimizeOption = - 1 ; if ( $ this -> environment [ 'cache' ] === false ) { $ optimizeOption = 2 ; } switch ( $ optimizeOption ) { case - 1 : $ nodeVisitorOptimizer = Twig_NodeVisitor_Optimizer :: OPTIMIZE_ALL ; break ; case 0 : $ nodeVisitorOptimizer = Twig_NodeVisitor_Optimizer :: OPTIMIZE_NONE ; break ; case 2 : $ nodeVisitorOptimizer = Twig_NodeVisitor_Optimizer :: OPTIMIZE_FOR ; break ; case 4 : $ nodeVisitorOptimizer = Twig_NodeVisitor_Optimizer :: OPTIMIZE_RAW_FILTER ; break ; case 8 : $ nodeVisitorOptimizer = Twig_NodeVisitor_Optimizer :: OPTIMIZE_VAR_ACCESS ; break ; default : $ nodeVisitorOptimizer = Twig_NodeVisitor_Optimizer :: OPTIMIZE_ALL ; break ; } $ optimizer = new Twig_Extension_Optimizer ( $ nodeVisitorOptimizer ) ; $ this -> twig -> addExtension ( $ optimizer ) ; }
optimize twig-output

OPTIMIZE_ALL (-1) | OPTIMIZE_NONE (0) | OPTIMIZE_FOR (2) | OPTIMIZE_RAW_FILTER (4) | OPTIMIZE_VAR_ACCESS (8)
optimize twig - output