AfterPageAndLanguageIsResolvedEvent

New in version 12.0: This PSR-14 event replaces the following hooks:

  • $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['determineId-PostProc']

  • $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['settingLanguage_postProcess']

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\AfterPageAndLanguageIsResolvedEvent is fired in the frontend process after a given page has been resolved including its language.

This event modifies TYPO3's language resolution logic through custom additions. It also allows sending a custom response via event listeners (for example, a custom 403 response).

Note

There are three events in the process around the resolving of a page and its root line or language based on the incoming request. They are triggered in the following order:

  1. BeforePageIsResolvedEvent

  2. AfterPageWithRootLineIsResolvedEvent

  3. AfterPageAndLanguageIsResolvedEvent

Example

Note

Currently, we do not have an example for this event. If you can provide a useful one, please open an issue with your code snippets or a pull request.

API

class TYPO3\CMS\Frontend\Event\AfterPageAndLanguageIsResolvedEvent

A PSR-14 event fired in the frontend process after a given page has been resolved including its language.

This event is intended to e.g. modify TYPO3's language resolving logic by custom additions. This event also allows to send a custom Response via Event Listeners (e.g. a custom 403 response)

getRequest()
Return type

Psr\Http\Message\ServerRequestInterface

getPageInformation()
Return type

TYPO3\CMS\Frontend\Page\PageInformation

setPageInformation(TYPO3\\CMS\\Frontend\\Page\\PageInformation $pageInformation)
Parameters
  • $pageInformation (TYPO3\CMS\Frontend\Page\PageInformation) -- the pageInformation

getResponse()
Return type

Psr\Http\Message\ResponseInterface

setResponse(Psr\\Http\\Message\\ResponseInterface $response)
Parameters
  • $response (Psr\Http\Message\ResponseInterface) -- the response

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.