function twig_source in Translation template extractor 7.3
Same name and namespace in other branches
- 6.3 vendor/Twig/Extension/Core.php \twig_source()
Returns a template content without rendering it.
Parameters
Twig_Environment $env:
string $name The template name:
bool $ignoreMissing Whether to ignore missing templates or not:
Return value
string The template source
1 string reference to 'twig_source'
- Twig_Extension_Core::getFunctions in vendor/
Twig/ Extension/ Core.php - Returns a list of functions to add to the existing list.
File
- vendor/
Twig/ Extension/ Core.php, line 1486
Code
function twig_source(Twig_Environment $env, $name, $ignoreMissing = false) {
try {
return $env
->getLoader()
->getSource($name);
} catch (Twig_Error_Loader $e) {
if (!$ignoreMissing) {
throw $e;
}
}
}