RedirectWasHitEvent

final class \TYPO3\CMS\Redirects\Event\RedirectWasHitEvent

This event is fired in the \TYPO3\CMS\Redirects\Http\Middleware\RedirectHandler middleware when a request matches a configured redirect.

It can be used to further process the matched redirect and to adjust the PSR-7 Response. It furthermore allows to influence Core functionality, for example the hit count increment.

Table of Contents

Methods

__construct()  : mixed
getMatchedRedirect()  : array
getRequest()  : ServerRequestInterface
getResponse()  : ResponseInterface
getTargetUrl()  : UriInterface
setMatchedRedirect()  : void
setResponse()  : void

Methods

__construct()

public __construct(ServerRequestInterface $request, ResponseInterface $response, array $matchedRedirect, UriInterface $targetUrl) : mixed

Parameters

$request : ServerRequestInterface
$response : ResponseInterface
$matchedRedirect : array
$targetUrl : UriInterface

getMatchedRedirect()

public getMatchedRedirect() : array

Return values

array

getRequest()

public getRequest() : ServerRequestInterface

Return values

ServerRequestInterface

getResponse()

public getResponse() : ResponseInterface

Return values

ResponseInterface

getTargetUrl()

public getTargetUrl() : UriInterface

Return values

UriInterface

setMatchedRedirect()

public setMatchedRedirect(array $matchedRedirect) : void

Parameters

$matchedRedirect : array

setResponse()

public setResponse(ResponseInterface $response) : void

Parameters

$response : ResponseInterface
On this page