function StringLoaderExtension::templateFromString
Loads a template from a string.
{{ include(template_from_string("Hello {{ name }}")) }}
@internal
Parameters
string|null $name An optional name of the template to be used in error messages:
1 call to StringLoaderExtension::templateFromString()
- twig_template_from_string in vendor/
twig/ twig/ src/ Resources/ string_loader.php - @internal
File
-
vendor/
twig/ twig/ src/ Extension/ StringLoaderExtension.php, line 36
Class
Namespace
Twig\ExtensionCode
public static function templateFromString(Environment $env, string|\Stringable $template, ?string $name = null) : TemplateWrapper {
return $env->createTemplate((string) $template, $name);
}