ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
StringLoader.php File Reference

Go to the source code of this file.

Data Structures

class  Twig_Extension_StringLoader
 

Functions

 twig_template_from_string (Twig_Environment $env, $template)
 Loads a template from a string. More...
 

Function Documentation

◆ twig_template_from_string()

twig_template_from_string ( Twig_Environment  $env,
  $template 
)

Loads a template from a string.

{{ include(template_from_string("Hello {{ name }}")) }}
Parameters
Twig_Environment$envA Twig_Environment instance
string$templateA template as a string or object implementing __toString()
Returns
Twig_Template

Definition at line 42 of file StringLoader.php.

References $template, and Twig_Environment\createTemplate().

43 {
44  return $env->createTemplate((string) $template);
45 }
$template
createTemplate($template)
Creates a template from source.
+ Here is the call graph for this function: