RouteMap
in package

Contains route paths associated with target objects.

The target objects define what should happen when a request is mapped to the given route.

Table of Contents

Methods

__construct()  : mixed
add()  : void
Associates a request method, route and a target object.
match()  : RoutableInterface|ResolvedRoute|RouteNotRegistered
Attempts to locate an object associated with a given route.

Methods

__construct()

public __construct(PropertyInjectorInterface $propertyInjector) : mixed
Parameters
$propertyInjector : PropertyInjectorInterface
Return values
mixed

add()

Associates a request method, route and a target object.

public add(RequestMethods $method, string $route, RoutableInterface|RoutableFactoryInterface $entry) : void
Parameters
$method : RequestMethods
$route : string
$entry : RoutableInterface|RoutableFactoryInterface
Return values
void

match()

Attempts to locate an object associated with a given route.

public match(ServerRequestInterface $request) : RoutableInterface|ResolvedRoute|RouteNotRegistered

The object defines an action that will be executed for HTTP requests that match the associated route.

Result matrix

  1. Not Parameterized => Target Object
  2. Parameterized => Target Object w/ metadata
  3. Not Located => RouteNotRegistered
Parameters
$request : ServerRequestInterface
Return values
RoutableInterface|ResolvedRoute|RouteNotRegistered

Search results