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

Breadcrumb

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

class ContainerLoader

A route loader that executes a service from a PSR-11 container to load the routes.

@author Ryan Weaver <ryan@knpuniversity.com>

Hierarchy

  • class \Symfony\Component\Routing\Loader\ObjectLoader extends \Symfony\Component\Config\Loader\Loader
    • class \Symfony\Component\Routing\Loader\ContainerLoader extends \Symfony\Component\Routing\Loader\ObjectLoader

Expanded class hierarchy of ContainerLoader

File

vendor/symfony/routing/Loader/ContainerLoader.php, line 21

Namespace

Symfony\Component\Routing\Loader
View source
class ContainerLoader extends ObjectLoader {
    public function __construct(ContainerInterface $container, ?string $env = null) {
        parent::__construct($env);
    }
    public function supports(mixed $resource, ?string $type = null) : bool {
        return 'service' === $type && \is_string($resource);
    }
    protected function getObject(string $id) : object {
        return $this->container
            ->get($id);
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title
ContainerLoader::getObject protected function Returns the object that the method will be called on to load routes. Overrides ObjectLoader::getObject
ContainerLoader::supports public function
ContainerLoader::__construct public function
ObjectLoader::addClassResource private function
ObjectLoader::load public function Calls the object method that will load the routes.

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal