Documentation

ContainerLoader extends ObjectLoader
in package

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

Tags
author

Ryan Weaver ryan@knpuniversity.com

Table of Contents

Properties

$env  : mixed
$resolver  : mixed
$container  : ContainerInterface

Methods

__construct()  : mixed
getResolver()  : LoaderResolverInterface
Gets the loader resolver.
import()  : mixed
Imports a resource.
load()  : mixed
Calls the object method that will load the routes.
resolve()  : LoaderInterface
Finds a loader able to load an imported resource.
setResolver()  : void
Sets the loader resolver.
supports()  : bool
Returns whether this class supports the given resource.
getObject()  : object
Returns the object that the method will be called on to load routes.

Properties

$resolver

protected mixed $resolver

Methods

import()

Imports a resource.

public import(mixed $resource[, string|null $type = null ]) : mixed
Parameters
$resource : mixed
$type : string|null = null

load()

Calls the object method that will load the routes.

public load(mixed $resource[, string|null $type = null ]) : mixed
Parameters
$resource : mixed
$type : string|null = null

resolve()

Finds a loader able to load an imported resource.

public resolve(mixed $resource[, string|null $type = null ]) : LoaderInterface
Parameters
$resource : mixed
$type : string|null = null
Tags
throws
LoaderLoadException

If no loader is found

Return values
LoaderInterface

supports()

Returns whether this class supports the given resource.

public supports(mixed $resource[, string|null $type = null ]) : bool
Parameters
$resource : mixed

A resource

$type : string|null = null
Return values
bool

getObject()

Returns the object that the method will be called on to load routes.

protected getObject(string $id) : object

For example, if your application uses a service container, the $id may be a service id.

Parameters
$id : string
Return values
object

        
On this page

Search results