ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
String.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 
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);
13 
31 {
32  public function getSource($name)
33  {
34  @trigger_error(sprintf('Calling "getSource" on "%s" is deprecated since 1.27. Use getSourceContext() instead.', get_class($this)), E_USER_DEPRECATED);
35 
36  return $name;
37  }
38 
39  public function getSourceContext($name)
40  {
41  return new Twig_Source($name, $name);
42  }
43 
44  public function exists($name)
45  {
46  return true;
47  }
48 
49  public function getCacheKey($name)
50  {
51  return $name;
52  }
53 
54  public function isFresh($name, $time)
55  {
56  return true;
57  }
58 }
exists($name)
Check if we have the source code of a template, given its name.
Definition: String.php:44
getSourceContext($name)
Returns the source context for a given template logical name.
Definition: String.php:39
$time
Definition: cron.php:21
isFresh($name, $time)
Returns true if the template is still fresh.
Definition: String.php:54
Adds an exists() method for loaders.
Adds a getSourceContext() method for loaders.
getSource($name)
Gets the source code of a template, given its name.
Definition: String.php:32
getCacheKey($name)
Gets the cache key to use for the cache for a given template name.
Definition: String.php:49
Holds information about a non-compiled Twig template.
Definition: Source.php:19
Interface all loaders must implement.