‪TYPO3CMS  ‪main
TYPO3\CMS\Redirects\Event\RedirectWasHitEvent Class Reference

Public Member Functions

 __construct (private readonly ServerRequestInterface $request, private ResponseInterface $response, private array $matchedRedirect, private readonly UriInterface $targetUrl)
 
 getRequest ()
 
 getTargetUrl ()
 
 setMatchedRedirect (array $matchedRedirect)
 
 getMatchedRedirect ()
 
 setResponse (ResponseInterface $response)
 
 getResponse ()
 

Detailed Description

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.

Definition at line 32 of file RedirectWasHitEvent.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Redirects\Event\RedirectWasHitEvent::__construct ( private readonly ServerRequestInterface  $request,
private ResponseInterface  $response,
private array  $matchedRedirect,
private readonly UriInterface  $targetUrl 
)

Definition at line 34 of file RedirectWasHitEvent.php.

Member Function Documentation

◆ getMatchedRedirect()

TYPO3\CMS\Redirects\Event\RedirectWasHitEvent::getMatchedRedirect ( )

◆ getRequest()

TYPO3\CMS\Redirects\Event\RedirectWasHitEvent::getRequest ( )

Definition at line 41 of file RedirectWasHitEvent.php.

◆ getResponse()

TYPO3\CMS\Redirects\Event\RedirectWasHitEvent::getResponse ( )

Definition at line 66 of file RedirectWasHitEvent.php.

◆ getTargetUrl()

TYPO3\CMS\Redirects\Event\RedirectWasHitEvent::getTargetUrl ( )

Definition at line 46 of file RedirectWasHitEvent.php.

References TYPO3\CMS\Redirects\Message\$targetUrl.

◆ setMatchedRedirect()

TYPO3\CMS\Redirects\Event\RedirectWasHitEvent::setMatchedRedirect ( array  $matchedRedirect)

◆ setResponse()

TYPO3\CMS\Redirects\Event\RedirectWasHitEvent::setResponse ( ResponseInterface  $response)

Definition at line 61 of file RedirectWasHitEvent.php.