Dispatcher implements DispatcherInterface

Dispatcher which resolves a target, which was given to the request to call a controller and method (but also a callable) where the request contains a "target" as attribute.

Used in eID Frontend Requests, see EidHandler

Table of Contents

Interfaces

DispatcherInterface
An interface for dispatcher that delegate requests to a certain callable, typically a controller / action combination. Usually called from the RequestHandler.

Properties

$container  : ContainerInterface

Methods

__construct()  : mixed
dispatch()  : ResponseInterface
Main method that fetches the target from the request and calls the target directly
getCallableFromTarget()  : callable
Creates a callable out of the given parameter, which can be a string, a callable / closure or an array which can be invoked as a function.

Properties

$container

protected ContainerInterface $container

Methods

__construct()

public __construct(ContainerInterface $container) : mixed
Parameters
$container : ContainerInterface

dispatch()

Main method that fetches the target from the request and calls the target directly

public dispatch(ServerRequestInterface $request) : ResponseInterface
Parameters
$request : ServerRequestInterface

the current server request

Tags
throws
InvalidArgumentException

if the defined target is invalid

Return values
ResponseInterface

the filled response by the callable/controller/action

getCallableFromTarget()

Creates a callable out of the given parameter, which can be a string, a callable / closure or an array which can be invoked as a function.

protected getCallableFromTarget(array<string|int, mixed>|string|callable $target) : callable
Parameters
$target : array<string|int, mixed>|string|callable

the target which is being resolved.

Tags
throws
InvalidArgumentException
Return values
callable

        
On this page

Search results