function StringLoader::getSourceContext

Same name in other branches
  1. 9 core/lib/Drupal/Core/Template/Loader/StringLoader.php \Drupal\Core\Template\Loader\StringLoader::getSourceContext()
  2. 8.9.x core/lib/Drupal/Core/Template/Loader/StringLoader.php \Drupal\Core\Template\Loader\StringLoader::getSourceContext()
  3. 10 core/lib/Drupal/Core/Template/Loader/StringLoader.php \Drupal\Core\Template\Loader\StringLoader::getSourceContext()

File

core/lib/Drupal/Core/Template/Loader/StringLoader.php, line 57

Class

StringLoader
Loads string templates, also known as inline templates.

Namespace

Drupal\Core\Template\Loader

Code

public function getSourceContext(string $name) : Source {
    $name = (string) $name;
    return new Source($name, $name);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.