ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ContainerRuntimeLoader.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of Twig.
5  *
6  * (c) Fabien Potencier
7  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  */
11 
13 
23 {
24  private $container;
25 
27  {
28  $this->container = $container;
29  }
30 
31  public function load($class)
32  {
33  if ($this->container->has($class)) {
34  return $this->container->get($class);
35  }
36  }
37 }
38 
39 class_alias('Twig_ContainerRuntimeLoader', 'Twig\RuntimeLoader\ContainerRuntimeLoader', false);
Lazily loads Twig runtime implementations from a PSR-11 container.
Creates runtime implementations for Twig elements (filters/functions/tests).
Describes the interface of a container that exposes methods to read its entries.
__construct(ContainerInterface $container)
load($class)
Creates the runtime implementation of a Twig element (filter/function/test).