ClosureLoader
extends Loader
in package
ClosureLoader loads routes from a PHP closure.
The Closure must return a RouteCollection instance.
Tags
Table of Contents
Properties
Methods
- __construct() : mixed
- getResolver() : LoaderResolverInterface
- Gets the loader resolver.
- import() : mixed
- Imports a resource.
- load() : mixed
- Loads a Closure.
- 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.
Properties
$env
protected
mixed
$env
$resolver
protected
mixed
$resolver
Methods
__construct()
public
__construct([string|null $env = null ]) : mixed
Parameters
- $env : string|null = null
getResolver()
Gets the loader resolver.
public
getResolver() : LoaderResolverInterface
Return values
LoaderResolverInterfaceimport()
Imports a resource.
public
import(mixed $resource[, string|null $type = null ]) : mixed
Parameters
- $resource : mixed
- $type : string|null = null
load()
Loads a Closure.
public
load(mixed $closure[, string|null $type = null ]) : mixed
Parameters
- $closure : 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
Return values
LoaderInterfacesetResolver()
Sets the loader resolver.
public
setResolver(LoaderResolverInterface $resolver) : void
Parameters
- $resolver : LoaderResolverInterface
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