Twig_Empty_Loader.php 942 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. /**
  3. * @link http://www.yiiframework.com/
  4. * @copyright Copyright (c) 2008 Yii Software LLC
  5. * @license http://www.yiiframework.com/license/
  6. */
  7. namespace yii\twig;
  8. /**
  9. * Empty loader used for environment initialisation
  10. *
  11. * @author Andrzej Broński <andrzej1_1@o2.pl>
  12. */
  13. class Twig_Empty_Loader implements \Twig_LoaderInterface
  14. {
  15. /**
  16. * @inheritdoc
  17. */
  18. public function getSourceContext($name)
  19. {
  20. throw new \Twig_Error_Loader("Can not render using empty loader");
  21. }
  22. /**
  23. * @inheritdoc
  24. */
  25. public function getCacheKey($name)
  26. {
  27. throw new \Twig_Error_Loader("Can not render using empty loader");
  28. }
  29. /**
  30. * @inheritdoc
  31. */
  32. public function isFresh($name, $time)
  33. {
  34. throw new \Twig_Error_Loader("Can not render using empty loader");
  35. }
  36. /**
  37. * @inheritdoc
  38. */
  39. public function exists($name)
  40. {
  41. return false;
  42. }
  43. }