ContainerLoader
extends ObjectLoader
in package
A route loader that executes a service from a PSR-11 container to load the routes.
Tags
Table of Contents
Properties
- $env : mixed
- $resolver : mixed
- $container : mixed
Methods
- __construct() : mixed
- getResolver() : LoaderResolverInterface
- Gets the loader resolver.
- import() : mixed
- Imports a resource.
- load() : RouteCollection
- Calls the object method that will load the routes.
- resolve() : LoaderInterface
- Finds a loader able to load an imported resource.
- setResolver() : mixed
- Sets the loader resolver.
- supports() : bool
- {@inheritdoc}
- getObject() : object
- Returns the object that the method will be called on to load routes.
- addClassResource() : mixed
Properties
$env
protected
mixed
$env
$resolver
protected
mixed
$resolver
$container
private
mixed
$container
Methods
__construct()
public
__construct(ContainerInterface $container[, string $env = null ]) : mixed
Parameters
- $container : ContainerInterface
- $env : string = null
getResolver()
Gets the loader resolver.
public
getResolver() : LoaderResolverInterface
Return values
LoaderResolverInterfaceimport()
Imports a resource.
public
import(mixed $resource[, string $type = null ]) : mixed
Parameters
- $resource : mixed
- $type : string = null
load()
Calls the object method that will load the routes.
public
load(mixed $resource[, string $type = null ]) : RouteCollection
Parameters
- $resource : mixed
- $type : string = null
Return values
RouteCollectionresolve()
Finds a loader able to load an imported resource.
public
resolve(mixed $resource[, string $type = null ]) : LoaderInterface
Parameters
- $resource : mixed
- $type : string = null
Tags
Return values
LoaderInterfacesetResolver()
Sets the loader resolver.
public
setResolver(LoaderResolverInterface $resolver) : mixed
Parameters
- $resolver : LoaderResolverInterface
supports()
{@inheritdoc}
public
supports(mixed $resource[, string $type = null ]) : bool
Parameters
- $resource : mixed
- $type : string = null
Return values
boolgetObject()
Returns the object that the method will be called on to load routes.
protected
getObject(string $id) : object
Parameters
- $id : string
Return values
objectaddClassResource()
private
addClassResource(ReflectionClass $class, RouteCollection $collection) : mixed
Parameters
- $class : ReflectionClass
- $collection : RouteCollection