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.
13 * Interface all loaders must implement.
15 * @author Fabien Potencier <fabien@symfony.com>
17 interface Twig_LoaderInterface
20 * Gets the source code of a template, given its name.
22 * @param string $name The name of the template to load
24 * @return string The template source code
26 * @throws Twig_Error_Loader When $name is not found
28 * @deprecated since 1.27 (to be removed in 2.0), implement Twig_SourceContextLoaderInterface
30 public function getSource($name);
33 * Gets the cache key to use for the cache for a given template name.
35 * @param string $name The name of the template to load
37 * @return string The cache key
39 * @throws Twig_Error_Loader When $name is not found
41 public function getCacheKey($name);
44 * Returns true if the template is still fresh.
46 * @param string $name The template name
47 * @param int $time Timestamp of the last modification time of the
50 * @return bool true if the template is fresh, false otherwise
52 * @throws Twig_Error_Loader When $name is not found
54 public function isFresh($name, $time);