public function TestLoader::getSourceContext in Drupal 8
Same name and namespace in other branches
- 9 core/modules/system/tests/modules/twig_loader_test/src/Loader/TestLoader.php \Drupal\twig_loader_test\Loader\TestLoader::getSourceContext()
File
- core/
modules/ system/ tests/ modules/ twig_loader_test/ src/ Loader/ TestLoader.php, line 15
Class
- TestLoader
- A test Twig loader.
Namespace
Drupal\twig_loader_test\LoaderCode
public function getSourceContext($name) {
$name = (string) $name;
$value = $name === 'kittens' ? 'kittens' : 'cats';
return new Source($value, $name);
}