Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. EscaperExtension.php

function EscaperExtension::getDefaultStrategy

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

Parameters

string $name The template name:

Return value

string|false The default strategy to use for the template

File

vendor/twig/twig/src/Extension/EscaperExtension.php, line 108

Class

EscaperExtension

Namespace

Twig\Extension

Code

public function getDefaultStrategy(string $name) {
    // disable string callables to avoid calling a function named html or js,
    // or any other upcoming escaping strategy
    if (!\is_string($this->defaultStrategy) && false !== $this->defaultStrategy) {
        return \call_user_func($this->defaultStrategy, $name);
    }
    return $this->defaultStrategy;
}
RSS feed
Powered by Drupal