LoaderInterface.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. interface LoaderInterface
  19. {
  20. /**
  21. * Loads a template.
  22. *
  23. * @param TemplateReferenceInterface $template A template
  24. *
  25. * @return Storage|bool false if the template cannot be loaded, a Storage instance otherwise
  26. */
  27. public function load(TemplateReferenceInterface $template);
  28. /**
  29. * Returns true if the template is still fresh.
  30. *
  31. * @param TemplateReferenceInterface $template A template
  32. * @param int $time The last modification time of the cached template (timestamp)
  33. *
  34. * @return bool
  35. */
  36. public function isFresh(TemplateReferenceInterface $template, $time);
  37. }