123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- <?php
-
-
-
-
- class Twig_Loader_Chain implements Twig_LoaderInterface
- {
- protected $loaders;
-
-
-
- public function __construct(array $loaders = array())
- {
- $this->loaders = array();
- foreach ($loaders as $loader) {
- $this->addLoader($loader);
- }
- }
-
-
-
- public function addLoader(Twig_LoaderInterface $loader)
- {
- $this->loaders[] = $loader;
- }
-
-
-
- public function getSource($name)
- {
- foreach ($this->loaders as $loader) {
- try {
- return $loader->getSource($name);
- } catch (Twig_Error_Loader $e) {
- }
- }
-
- throw new Twig_Error_Loader(sprintf('Template "%s" is not defined.', $name));
- }
-
-
-
- public function getCacheKey($name)
- {
- foreach ($this->loaders as $loader) {
- try {
- return $loader->getCacheKey($name);
- } catch (Twig_Error_Loader $e) {
- }
- }
-
- throw new Twig_Error_Loader(sprintf('Template "%s" is not defined.', $name));
- }
-
-
-
- public function isFresh($name, $time)
- {
- foreach ($this->loaders as $loader) {
- try {
- return $loader->isFresh($name, $time);
- } catch (Twig_Error_Loader $e) {
- }
- }
-
- throw new Twig_Error_Loader(sprintf('Template "%s" is not defined.', $name));
- }
- }
|