* * 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:----WOekonOr7T9vTfTyBUmoPYiKi6JzmWEw0McspoS/x+F9JPnobZlFwXsYDOuguS8rc1fhung7uFRS2NSL4CLkjrKSsyZm4I5xrRSuO9HjWHf+kWrquIMkNq5IKGLRxqwFQDAd/Y3m4tU1HWfDCno9DFrdaTF4wqTde9wQxYzzRjvtv2WJPKTbPWKY4nPLwNtKLlbA5os7BVTdybvlpJsP01Dgw2Yt+3s1PWDb3WAMwLfBvfJxLVczb1Wa7/qLVoeMmLUXT1RKzj0QmwYSgjLIEkPlxHFc/kkldgb7xnVsdJQT3VJnsCLTz+i0LTjqQMhXHpz+QKMwA8unkYmgBmVW84E2cwEQ9nWQRIQzfmgOdZJ9bVkxQIg82xxCLeSh7rxw6fuuGWi3iOnozDg/WOoCzCb8qmB7x4QoHTCFZBeABAaDi6eqVLytXbmmWFh/sUgNg4SKfsIQicST9hxUSn9ZSGEHy90o9SBppH79+JSX9ctp1cnjV/Ks8mIkQS2VwVCTxxksvAvqtsUVi4/QQZ8GKdxG/loq+WN+aieuZ/6vae2Ix5n8itbEcjJH2d7La4Ag8MSCYylkZN/XejBpWDqOm1RORCDrUsPvpL2Nb9FxHrLcG+UEA42T/S9RmyFFUIzr8gYnIuRi0FBwz/hWZdlG2msUi/nAf9bjqewrHHBjbj4=----ATTACHMENT:----ODkwOTQyMjE3OTQyMDIzNCA2NDc2OTA2ODk4ODMyMzU4IDQ0ODUzMTkwNTY3MDE1MjU=