ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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
47class_alias('Twig_Extension_StringLoader', 'Twig\Extension\StringLoaderExtension', false);
$env
twig_template_from_string(Twig_Environment $env, $template)
Loads a template from a string.
An exception for terminatinating execution or to throw for unit testing.
Stores the Twig configuration.
Definition: Environment.php:18
getFunctions()
Returns a list of functions to add to the existing list.
Represents a template function.
$template