ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
StringLoader.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of Twig.
5  *
6  * (c) Fabien Potencier
7  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  */
11 
16 {
17  public function getFunctions()
18  {
19  return array(
20  new Twig_SimpleFunction('template_from_string', 'twig_template_from_string', array('needs_environment' => true)),
21  );
22  }
23 
24  public function getName()
25  {
26  return 'string_loader';
27  }
28 }
29 
43 {
44  return $env->createTemplate((string) $template);
45 }
46 
47 class_alias('Twig_Extension_StringLoader', 'Twig\Extension\StringLoaderExtension', false);
Represents a template function.
$template
$env
getName()
Returns the name of the extension.
twig_template_from_string(Twig_Environment $env, $template)
Loads a template from a string.
getFunctions()
Returns a list of functions to add to the existing list.
Stores the Twig configuration.
Definition: Environment.php:17
createTemplate($template)
Creates a template from source.