Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ContainerRuntimeLoader.php

class ContainerRuntimeLoader

Lazily loads Twig runtime implementations from a PSR-11 container.

Note that the runtime services MUST use their class names as identifiers.

@author Fabien Potencier <fabien@symfony.com> @author Robin Chalas <robin.chalas@gmail.com>

Hierarchy

  • class \Twig\RuntimeLoader\ContainerRuntimeLoader implements \Twig\RuntimeLoader\RuntimeLoaderInterface

Expanded class hierarchy of ContainerRuntimeLoader

File

vendor/twig/twig/src/RuntimeLoader/ContainerRuntimeLoader.php, line 24

Namespace

Twig\RuntimeLoader
View source
class ContainerRuntimeLoader implements RuntimeLoaderInterface {
    public function __construct(ContainerInterface $container) {
    }
    public function load(string $class) {
        return $this->container
            ->has($class) ? $this->container
            ->get($class) : null;
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title
ContainerRuntimeLoader::load public function Creates the runtime implementation of a Twig element (filter/function/test). Overrides RuntimeLoaderInterface::load
ContainerRuntimeLoader::__construct public function
RSS feed
Powered by Drupal