4 * This file is part of Twig.
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 @trigger_error('The Twig_Loader_String class is deprecated since version 1.18.1 and will be removed in 2.0. Use Twig_Loader_Array instead or Twig_Environment::createTemplate().', E_USER_DEPRECATED);
15 * Loads a template from a string.
17 * This loader should NEVER be used. It only exists for Twig internal purposes.
19 * When using this loader with a cache mechanism, you should know that a new cache
20 * key is generated each time a template content "changes" (the cache key being the
21 * source code of the template). If you don't want to see your cache grows out of
22 * control, you need to take care of clearing the old cache file by yourself.
24 * @deprecated since 1.18.1 (to be removed in 2.0)
28 * @author Fabien Potencier <fabien@symfony.com>
30 class Twig_Loader_String implements Twig_LoaderInterface, Twig_ExistsLoaderInterface, Twig_SourceContextLoaderInterface
32 public function getSource($name)
34 @trigger_error(sprintf('Calling "getSource" on "%s" is deprecated since 1.27. Use getSourceContext() instead.', get_class($this)), E_USER_DEPRECATED);
39 public function getSourceContext($name)
41 return new Twig_Source($name, $name);
44 public function exists($name)
49 public function getCacheKey($name)
54 public function isFresh($name, $time)