ServiceRouterLoader
extends ObjectRouteLoader
in package
A route loader that executes a service to load the routes.
Tags
Table of Contents
- $container : ContainerInterface
- __construct() : mixed
- load() : RouteCollection
- Calls the service that will load the routes.
- supports() : mixed
- {@inheritdoc}
- getServiceObject() : object
- Returns the object that the method will be called on to load routes.
- addClassResource() : mixed
Properties
$container
private
ContainerInterface
$container
Methods
__construct()
public
__construct(ContainerInterface $container) : mixed
Parameters
- $container : ContainerInterface
Return values
mixed —load()
Calls the service that will load the routes.
public
load(mixed $resource[, string|null $type = null ]) : RouteCollection
Parameters
- $resource : mixed
-
Some value that will resolve to a callable
- $type : string|null = null
-
The resource type
Return values
RouteCollection —supports()
{@inheritdoc}
public
supports(mixed $resource[, mixed $type = null ]) : mixed
Parameters
- $resource : mixed
- $type : mixed = null
Return values
mixed —getServiceObject()
Returns the object that the method will be called on to load routes.
protected
getServiceObject(mixed $id) : object
For example, if your application uses a service container, the $id may be a service id.
Parameters
- $id : mixed
Return values
object —addClassResource()
private
addClassResource(ReflectionClass $class, RouteCollection $collection) : mixed
Parameters
- $class : ReflectionClass
- $collection : RouteCollection