PageContentErrorHandler implements PageErrorHandlerInterface
Renders the content of a page to be displayed (also in relation to language etc) This is typically configured via the "Sites configuration" module in the backend.
Table of Contents
Interfaces
- PageErrorHandlerInterface
- Page error handler interface, used to jump in for Frontend-related calls
Properties
- $application : Application
- $cache : FrontendInterface
- $errorHandlerConfiguration : array<string|int, mixed>
- $link : LinkService
- $pageUid : int
- $requestFactory : RequestFactory
- $responseFactory : ResponseFactoryInterface
- $siteFinder : SiteFinder
- $statusCode : int
- $useSubrequest : bool
Methods
- __construct() : mixed
- PageContentErrorHandler constructor.
- handlePageError() : ResponseInterface
- cachePageRequest() : ResponseInterface
- Caches a subrequest fetch.
- createCachedPageRequestResponse() : ResponseInterface
- createGenericErrorResponse() : ResponseInterface
- getSubRequestOptions() : array<string|int, mixed>|array<string|int, int>
- Returns request options for the subrequest
- resolveUrl() : string
- Resolve the URL (currently only page and external URL are supported)
- sendRawRequest() : ResponseInterface
- Sends a full HTTP request to the specified URL.
- sendSubRequest() : ResponseInterface
- Sends an in-process subrequest.
- stashEnvironment() : ResponseInterface
- Stash and restore portions of the global environment around a subreqest callable.
Properties
$application
protected
Application
$application
$cache
protected
FrontendInterface
$cache
$errorHandlerConfiguration
protected
array<string|int, mixed>
$errorHandlerConfiguration
$link
protected
LinkService
$link
$pageUid
protected
int
$pageUid
= 0
$requestFactory
protected
RequestFactory
$requestFactory
$responseFactory
protected
ResponseFactoryInterface
$responseFactory
$siteFinder
protected
SiteFinder
$siteFinder
$statusCode
protected
int
$statusCode
$useSubrequest
protected
bool
$useSubrequest
Methods
__construct()
PageContentErrorHandler constructor.
public
__construct(int $statusCode, array<string|int, mixed> $configuration) : mixed
Parameters
- $statusCode : int
- $configuration : array<string|int, mixed>
Tags
handlePageError()
public
handlePageError(ServerRequestInterface $request, string $message[, array<string|int, mixed> $reasons = [] ]) : ResponseInterface
Parameters
- $request : ServerRequestInterface
- $message : string
- $reasons : array<string|int, mixed> = []
Return values
ResponseInterfacecachePageRequest()
Caches a subrequest fetch.
protected
cachePageRequest(int $pageId, callable $fetcher, string $cacheIdentifier) : ResponseInterface
Parameters
- $pageId : int
- $fetcher : callable
- $cacheIdentifier : string
Return values
ResponseInterfacecreateCachedPageRequestResponse()
protected
createCachedPageRequestResponse(array<string|int, mixed> $responseData) : ResponseInterface
Parameters
- $responseData : array<string|int, mixed>
Return values
ResponseInterfacecreateGenericErrorResponse()
protected
createGenericErrorResponse([string $message = '' ]) : ResponseInterface
Parameters
- $message : string = ''
Return values
ResponseInterfacegetSubRequestOptions()
Returns request options for the subrequest
protected
getSubRequestOptions() : array<string|int, mixed>|array<string|int, int>
Return values
array<string|int, mixed>|array<string|int, int>resolveUrl()
Resolve the URL (currently only page and external URL are supported)
protected
resolveUrl(ServerRequestInterface $request, array<string|int, mixed> $urlParams) : string
Parameters
- $request : ServerRequestInterface
- $urlParams : array<string|int, mixed>
Return values
stringsendRawRequest()
Sends a full HTTP request to the specified URL.
protected
sendRawRequest(string $resolvedUrl) : ResponseInterface
Parameters
- $resolvedUrl : string
Return values
ResponseInterfacesendSubRequest()
Sends an in-process subrequest.
protected
sendSubRequest(ServerRequestInterface $request, int $pageId, ServerRequestInterface $originalRequest) : ResponseInterface
The $pageId is used to ensure the correct site is accessed.
Parameters
- $request : ServerRequestInterface
- $pageId : int
- $originalRequest : ServerRequestInterface
Return values
ResponseInterfacestashEnvironment()
Stash and restore portions of the global environment around a subreqest callable.
protected
stashEnvironment(callable $fetcher) : ResponseInterface
Parameters
- $fetcher : callable