Documentation

Psr4DirectoryLoader extends Loader
in package
implements DirectoryAwareLoaderInterface

FinalYes

A loader that discovers controller classes in a directory that follows PSR-4.

Tags
author

Alexander M. Turek me@derrabus.de

Table of Contents

Interfaces

DirectoryAwareLoaderInterface
A loader that can be scoped to a given filesystem directory.

Properties

$env  : mixed
$resolver  : mixed
$currentDirectory  : string|null
$locator  : FileLocatorInterface

Methods

__construct()  : mixed
forDirectory()  : static
getResolver()  : LoaderResolverInterface
Gets the loader resolver.
import()  : mixed
Imports a resource.
load()  : mixed
Loads a resource.
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.
loadFromDirectory()  : RouteCollection

Properties

$resolver

protected mixed $resolver

Methods

forDirectory()

public forDirectory(string $currentDirectory) : static
Parameters
$currentDirectory : string
Return values
static

import()

Imports a resource.

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

load()

Loads a resource.

public load(array{path: string, namespace: string} $resource[, string|null $type = null ]) : mixed
Parameters
$resource : array{path: string, namespace: string}
$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

        
On this page

Search results