public function Twig_Extension_Escaper::setDefaultStrategy

Sets the default strategy to use when not defined by the user.

The strategy can be a valid PHP callback that takes the template "filename" as an argument and returns the strategy to use.

Parameters

mixed $defaultStrategy An escaping strategy:

1 call to Twig_Extension_Escaper::setDefaultStrategy()
Twig_Extension_Escaper::__construct in drupal/core/vendor/twig/twig/lib/Twig/Extension/Escaper.php

File

drupal/core/vendor/twig/twig/lib/Twig/Extension/Escaper.php, line 60

Class

Twig_Extension_Escaper

Code

public function setDefaultStrategy($defaultStrategy) {

  // for BC
  if (true === $defaultStrategy) {
    $defaultStrategy = 'html';
  }
  $this->defaultStrategy = $defaultStrategy;
}