You are here

public function Twig_Extension_Escaper::setDefaultStrategy in Translation template extractor 6.3

Same name and namespace in other branches
  1. 7.3 vendor/Twig/Extension/Escaper.php \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 vendor/Twig/Extension/Escaper.php

File

vendor/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;
}