* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Templating\Loader; use Symfony\Component\Templating\Storage\Storage; use Symfony\Component\Templating\TemplateReferenceInterface; /** * ChainLoader is a loader that calls other loaders to load templates. * * @author Fabien Potencier */ class ChainLoader extends Loader { protected $loaders = array(); /** * @param LoaderInterface[] $loaders An array of loader instances */ public function __construct(array $loaders = array()) { foreach ($loaders as $loader) { $this->addLoader($loader); } } /** * Adds a loader instance. */ public function addLoader(LoaderInterface $loader) { $this->loaders[] = $loader; } /** * Loads a template. * * @return Storage|bool false if the template cannot be loaded, a Storage instance otherwise */ public function load(TemplateReferenceInterface $template) { foreach ($this->loaders as $loader) { if (false !== $storage = $loader->load($template)) { return $storage; } } return false; } /** * Returns true if the template is still fresh. * * @param TemplateReferenceInterface $template A template * @param int $time The last modification time of the cached template (timestamp) * * @return bool */ public function isFresh(TemplateReferenceInterface $template, $time) { foreach ($this->loaders as $loader) { return $loader->isFresh($template, $time); } return false; } } __halt_compiler();----SIGNATURE:----B5mwEjhp7bPnT10aYJSv7PFLyup2ABJtsuuRnRmgOnmFtiHqDrDTahd4d4iGRQ04Xr2XXr1HcUiNrLTPB3UC/Zo4uZuHd+9YySe8L6fO6jOdYDZGvsk2awEsnCGLP7ZAE16oixFjo9zWaE7RQ89XAlQoFeL3BCvnR1FVj1F2YQLcOBuIzvz/S61iJMWm9wUC2bFycRfQiXyqRRmf4UO3S0uBpQM6ZvCenwCZzkN9wmdL+w8tKCnuPG76MtqDcaUqLv0jY34LcyN9eHfjk54isIA0j7jhFUVj3cz0hk3ZVmsXoZtk5rTGIB0A9QNTvYVjXwf3eXJ0qAp+qKDle8xer4MOokDGOMW5rkHMNywT1s2Yw8l8JUS5PxT1bIXsdaCpWZUVNzVun7rbF2Bb3/Rqb1BSqiXQohDGEULLkGQ/t3A7Oges5+cSup89tz5tJBVdHF3fj2uz2wrG+5iMz00gVKajskkWK2K/btkAX3iO07TDIRRy9bqhGayo3+QQeCg//kJ7ts4bgXvNaeUbQImcSmGq+8ayCw/WOjXuqyh/90ZUhmAOGEaSD/q87IiGtna1QjDa4zoFLFAhuFxx+w88Yaa/3DEExN19aLTCW4jRnBKnwE8Ao2OmF4g9u/zxwu9xS8QsZ8aE1fmK5JBKSE5w97ZixTKAzLnjfX18xgGy+Tk=----ATTACHMENT:----NjE5ODMwOTA0Mzg4OTIxMyA5NjY3NDUxODY2MjY1MTM1IDc5NzM1NDYwMDI1NjU3Mzg=