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

$errorHandlerConfiguration

protected array<string|int, mixed> $errorHandlerConfiguration

$responseFactory

protected ResponseFactoryInterface $responseFactory

$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
throws
InvalidArgumentException

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
ResponseInterface

cachePageRequest()

Caches a subrequest fetch.

protected cachePageRequest(int $pageId, callable $fetcher, string $cacheIdentifier) : ResponseInterface
Parameters
$pageId : int
$fetcher : callable
$cacheIdentifier : string
Return values
ResponseInterface

createCachedPageRequestResponse()

protected createCachedPageRequestResponse(array<string|int, mixed> $responseData) : ResponseInterface
Parameters
$responseData : array<string|int, mixed>
Return values
ResponseInterface

createGenericErrorResponse()

protected createGenericErrorResponse([string $message = '' ]) : ResponseInterface
Parameters
$message : string = ''
Return values
ResponseInterface

getSubRequestOptions()

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
string

sendRawRequest()

Sends a full HTTP request to the specified URL.

protected sendRawRequest(string $resolvedUrl) : ResponseInterface
Parameters
$resolvedUrl : string
Return values
ResponseInterface

sendSubRequest()

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
ResponseInterface

stashEnvironment()

Stash and restore portions of the global environment around a subreqest callable.

protected stashEnvironment(callable $fetcher) : ResponseInterface
Parameters
$fetcher : callable
Return values
ResponseInterface

        
On this page

Search results