BeforePageIsResolvedEvent

New in version 12.0

This PSR-14 event replaces the $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['determineId-PreProcessing'] hook.

Changed in version 13.0

The event no longer receives an instance of TypoScriptFrontendController, the getController() method has been removed: The controller is instantiated after the event has been dispatched, event listeners can no longer work with this object.

Instead, the event now contains an instance of the new DTO\TYPO3\CMS\Frontend\Page\PageInformation, which can be retrieved and manipulated by event listeners, if necessary.

See Migration.

The PSR-14 event \TYPO3\CMS\Frontend\Event\BeforePageIsResolvedEvent is fired before the frontend process is trying to fully resolve a given page by its page ID and the request.

The events may not be dispatched anymore when the middlewareTYPO3\CMS\Frontend\Middleware\TypoScriptFrontendInitialization creates early responses.

Example

API

class \TYPO3\CMS\Frontend\Event\ BeforePageIsResolvedEvent

A PSR-14 event fired before the frontend process is trying to fully resolve a given page by its page ID and the request.

Event Listeners can modify incoming parameters (such as $controller->id) or modify the context for resolving a page.

getRequest ( )
returntype

Psr\Http\Message\ServerRequestInterface

getPageInformation ( )
returntype

TYPO3\CMS\Frontend\Page\PageInformation

setPageInformation ( TYPO3\\CMS\\Frontend\\Page\\PageInformation $pageInformation)
param TYPO3\\CMS\\Frontend\\Page\\PageInformation $pageInformation

the pageInformation

Migration

Use the method getPageInformation() to retrieve the calculated page state at this point in the frontend rendering chain. Event listeners that manipulate that object should set it again within the event using setPageInformation().

In case the middleware TypoScriptFrontendInitialization no longer dispatches an event when it created an early response on its own, a custom middleware can be added around that middleware to retrieve and further manipulate a response if needed.