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\LoaderView 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. |