LoaderInterface.php 1.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /*
  3. * This file is part of Twig.
  4. *
  5. * (c) 2009 Fabien Potencier
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. /**
  11. * Interface all loaders must implement.
  12. *
  13. * @package twig
  14. * @author Fabien Potencier <fabien@symfony.com>
  15. */
  16. interface Twig_LoaderInterface
  17. {
  18. /**
  19. * Gets the source code of a template, given its name.
  20. *
  21. * @param string $name The name of the template to load
  22. *
  23. * @return string The template source code
  24. */
  25. function getSource($name);
  26. /**
  27. * Gets the cache key to use for the cache for a given template name.
  28. *
  29. * @param string $name The name of the template to load
  30. *
  31. * @return string The cache key
  32. */
  33. function getCacheKey($name);
  34. /**
  35. * Returns true if the template is still fresh.
  36. *
  37. * @param string $name The template name
  38. * @param timestamp $time The last modification time of the cached template
  39. */
  40. function isFresh($name, $time);
  41. }