Twig_FactoryRuntimeLoader

Lazy loads the runtime implementations for a Twig element.

Defined (1)

The class is defined in the following location(s).

/vendor/twig/twig/lib/Twig/FactoryRuntimeLoader.php  
  1. class Twig_FactoryRuntimeLoader implements Twig_RuntimeLoaderInterface 
  2. private $map; 
  3.  
  4. /** 
  5. * @param array $map An array where keys are class names and values factory callables 
  6. */ 
  7. public function __construct($map = array()) 
  8. $this->map = $map; 
  9.  
  10. public function load($class) 
  11. if (isset($this->map[$class])) { 
  12. $runtimeFactory = $this->map[$class]; 
  13.  
  14. return $runtimeFactory();