ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
Slim\Interfaces\RouterInterface Interface Reference
+ Inheritance diagram for Slim\Interfaces\RouterInterface:
+ Collaboration diagram for Slim\Interfaces\RouterInterface:

Public Member Functions

 map ($methods, $pattern, $handler)
 Add route. More...
 
 dispatch (ServerRequestInterface $request)
 Dispatch router for HTTP request. More...
 
 pushGroup ($pattern, $callable)
 Add a route group to the array. More...
 
 popGroup ()
 Removes the last route group from the array. More...
 
 getNamedRoute ($name)
 Get named route object. More...
 
 lookupRoute ($identifier)
 
 relativePathFor ($name, array $data=[], array $queryParams=[])
 Build the path for a named route excluding the base path. More...
 
 pathFor ($name, array $data=[], array $queryParams=[])
 Build the path for a named route including the base path. More...
 

Data Fields

const DISPATCH_STATUS = 0
 
const ALLOWED_METHODS = 1
 

Detailed Description

Definition at line 21 of file RouterInterface.php.

Member Function Documentation

◆ dispatch()

Slim\Interfaces\RouterInterface::dispatch ( ServerRequestInterface  $request)

Dispatch router for HTTP request.

Parameters
ServerRequestInterface$requestThe current HTTP request object
Returns
array

https://github.com/nikic/FastRoute/blob/master/src/Dispatcher.php

Implemented in Slim\Router.

Referenced by Slim\App\dispatchRouterAndPrepareRoute().

+ Here is the caller graph for this function:

◆ getNamedRoute()

Slim\Interfaces\RouterInterface::getNamedRoute (   $name)

Get named route object.

Parameters
string$nameRoute name
Returns
Exceptions
RuntimeExceptionIf named route does not exist

Implemented in Slim\Router.

◆ lookupRoute()

Slim\Interfaces\RouterInterface::lookupRoute (   $identifier)
Parameters
$identifier
Returns

Implemented in Slim\Router.

Referenced by Slim\App\dispatchRouterAndPrepareRoute().

+ Here is the caller graph for this function:

◆ map()

Slim\Interfaces\RouterInterface::map (   $methods,
  $pattern,
  $handler 
)

Add route.

Parameters
string[]$methods Array of HTTP methods
string$patternThe route pattern
callable$handlerThe route callable
Returns
RouteInterface

Implemented in Slim\Router.

◆ pathFor()

Slim\Interfaces\RouterInterface::pathFor (   $name,
array  $data = [],
array  $queryParams = [] 
)

Build the path for a named route including the base path.

Parameters
string$nameRoute name
array$dataNamed argument replacement data
array$queryParamsOptional query string parameters
Returns
string
Exceptions
RuntimeExceptionIf named route does not exist
InvalidArgumentExceptionIf required data not provided

Implemented in Slim\Router.

◆ popGroup()

Slim\Interfaces\RouterInterface::popGroup ( )

Removes the last route group from the array.

Returns
bool True if successful, else False

Implemented in Slim\Router.

◆ pushGroup()

Slim\Interfaces\RouterInterface::pushGroup (   $pattern,
  $callable 
)

Add a route group to the array.

Parameters
string$patternThe group pattern
callable$callableA group callable
Returns
RouteGroupInterface

Implemented in Slim\Router.

◆ relativePathFor()

Slim\Interfaces\RouterInterface::relativePathFor (   $name,
array  $data = [],
array  $queryParams = [] 
)

Build the path for a named route excluding the base path.

Parameters
string$nameRoute name
array$dataNamed argument replacement data
array$queryParamsOptional query string parameters
Returns
string
Exceptions
RuntimeExceptionIf named route does not exist
InvalidArgumentExceptionIf required data not provided

Implemented in Slim\Router.

Field Documentation

◆ ALLOWED_METHODS

const Slim\Interfaces\RouterInterface::ALLOWED_METHODS = 1

Definition at line 25 of file RouterInterface.php.

◆ DISPATCH_STATUS

const Slim\Interfaces\RouterInterface::DISPATCH_STATUS = 0

Definition at line 24 of file RouterInterface.php.


The documentation for this interface was generated from the following file: