LoaderInterface.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\Templating\Loader;
  11. use Symfony\Component\Templating\TemplateReferenceInterface;
  12. use Symfony\Component\Templating\Storage\Storage;
  13. /**
  14. * LoaderInterface is the interface all loaders must implement.
  15. *
  16. * @author Fabien Potencier <fabien@symfony.com>
  17. *
  18. * @api
  19. */
  20. interface LoaderInterface
  21. {
  22. /**
  23. * Loads a template.
  24. *
  25. * @param TemplateReferenceInterface $template A template
  26. *
  27. * @return Storage|Boolean false if the template cannot be loaded, a Storage instance otherwise
  28. *
  29. * @api
  30. */
  31. public function load(TemplateReferenceInterface $template);
  32. /**
  33. * Returns true if the template is still fresh.
  34. *
  35. * @param TemplateReferenceInterface $template A template
  36. * @param integer $time The last modification time of the cached template (timestamp)
  37. *
  38. * @return Boolean
  39. *
  40. * @api
  41. */
  42. public function isFresh(TemplateReferenceInterface $template, $time);
  43. }