Moodle PHP Documentation 5.1
Moodle 5.1dev (Build: 20250706) (a6b17d8f6bd)
core\router\response_handler Class Reference

Public Member Functions

 __construct (private ContainerInterface readonly ContainerInterface $container,)
 Create a new response handler.
 
 get_response_from_exception (ServerRequestInterface $request, Exception $exception,)
 Get the response from an exception.
 
 standardise_response (ResponseInterface|response_type $response,)
 Invoke a route callable.
 

Constructor & Destructor Documentation

◆ __construct()

core\router\response_handler::__construct ( private ContainerInterface readonly ContainerInterface $container)

Create a new response handler.

Parameters
ContainerInterface$container

Member Function Documentation

◆ get_response_from_exception()

core\router\response_handler::get_response_from_exception ( ServerRequestInterface $request,
Exception $exception )

Get the response from an exception.

Parameters
ServerRequestInterface$request
Exception$exception
Return values
ResponseInterface

◆ standardise_response()

core\router\response_handler::standardise_response ( ResponseInterface|response_type $response)

Invoke a route callable.

Note: Much of this is copied from the parent class, but we need to handle the response differently.

Parameters
ResponseInterface | response_type$responseThe response object.
Return values
ResponseInterfaceThe response from the callable.

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