ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Slim\Handlers\Strategies\RequestResponse Class Reference

Default route callback strategy with route parameters as an array of arguments. More...

+ Inheritance diagram for Slim\Handlers\Strategies\RequestResponse:
+ Collaboration diagram for Slim\Handlers\Strategies\RequestResponse:

Public Member Functions

 __invoke (callable $callable, ServerRequestInterface $request, ResponseInterface $response, array $routeArguments)
 Invoke a route callable with request, response, and all route parameters as an array of arguments. More...
 

Detailed Description

Default route callback strategy with route parameters as an array of arguments.

Definition at line 18 of file RequestResponse.php.

Member Function Documentation

◆ __invoke()

Slim\Handlers\Strategies\RequestResponse::__invoke ( callable  $callable,
ServerRequestInterface  $request,
ResponseInterface  $response,
array  $routeArguments 
)

Invoke a route callable with request, response, and all route parameters as an array of arguments.

Parameters
array | callable$callable
ServerRequestInterface$request
ResponseInterface$response
array$routeArguments
Returns
mixed

Implements Slim\Interfaces\InvocationStrategyInterface.

Definition at line 31 of file RequestResponse.php.

References Psr\Http\Message\ServerRequestInterface\withAttribute().

36  {
37  foreach ($routeArguments as $k => $v) {
38  $request = $request->withAttribute($k, $v);
39  }
40 
41  return call_user_func($callable, $request, $response, $routeArguments);
42  }
foreach($paths as $path) $request
Definition: asyncclient.php:32
$response
+ Here is the call graph for this function:

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