PhpFileLoader
extends FileLoader
in package
PhpFileLoader loads routes from a PHP file.
The file must return a RouteCollection instance.
Tags
Table of Contents
Properties
Methods
- __construct() : mixed
- getLocator() : FileLocatorInterface
- Returns the file locator used by this loader.
- getResolver() : LoaderResolverInterface
- Gets the loader resolver.
- import() : mixed
- Imports a resource.
- load() : mixed
- Loads a PHP file.
- resolve() : LoaderInterface
- Finds a loader able to load an imported resource.
- setCurrentDir() : void
- Sets the current directory.
- setResolver() : void
- Sets the loader resolver.
- supports() : bool
- Returns whether this class supports the given resource.
- callConfigurator() : RouteCollection
Properties
$env
protected
mixed
$env
$loading
protected
static mixed
$loading
= []
$locator
protected
mixed
$locator
$resolver
protected
mixed
$resolver
Methods
__construct()
public
__construct(FileLocatorInterface $locator[, string|null $env = null ]) : mixed
Parameters
- $locator : FileLocatorInterface
- $env : string|null = null
getLocator()
Returns the file locator used by this loader.
public
getLocator() : FileLocatorInterface
Return values
FileLocatorInterfacegetResolver()
Gets the loader resolver.
public
getResolver() : LoaderResolverInterface
Return values
LoaderResolverInterfaceimport()
Imports a resource.
public
import(mixed $resource[, string|null $type = null ][, bool $ignoreErrors = false ][, string|null $sourceResource = null ][, string|array<string|int, string>|null $exclude = null ]) : mixed
Parameters
- $resource : mixed
-
A Resource
- $type : string|null = null
-
The resource type or null if unknown
- $ignoreErrors : bool = false
-
Whether to ignore import errors or not
- $sourceResource : string|null = null
-
The original resource importing the new resource
- $exclude : string|array<string|int, string>|null = null
-
Glob patterns to exclude from the import
Tags
load()
Loads a PHP file.
public
load(mixed $file[, string|null $type = null ]) : mixed
Parameters
- $file : 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
LoaderInterfacesetCurrentDir()
Sets the current directory.
public
setCurrentDir(string $dir) : void
Parameters
- $dir : string
setResolver()
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
Return values
boolcallConfigurator()
protected
callConfigurator(callable $result, string $path, string $file) : RouteCollection
Parameters
- $result : callable
- $path : string
- $file : string