AfterPageWithRootLineIsResolvedEvent¶
New in version 12.0
This PSR-14 event replaces the following hooks:
Changed in version 13.0
The event no longer receives an instance of
Typo
, the get
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\
, which can be retrieved
and manipulated by event listeners, if necessary.
See Migration.
The PSR-14 event \TYPO3\
fires in the frontend process after a given page has been resolved with
permissions, root line, etc.
This is useful for modifying the page and root (but before resolving the language), to direct or load content from another page, or for modifying the page response if additional permissions should be checked.
Tip
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:
- BeforePageIsResolvedEvent
- AfterPageWithRootLineIsResolvedEvent
- 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 AfterPageWithRootLineIsResolvedEvent ¶
-
- Fully qualified name
-
\TYPO3\
CMS\ Frontend\ Event\ After Page With Root Line Is Resolved Event
A PSR-14 event fired in the frontend process after a given page has been resolved with permissions, rootline etc.
This is useful to modify the page + rootline (but before the language is resolved) to direct or load content from a different page, or modify the page response if additional permissions should be checked.
- getRequest ( ) ¶
-
- Returns
-
\Psr\
Http\ Message\ Server Request Interface
- setResponse ( \Psr\Http\Message\ResponseInterface $response) ¶
-
- param $response
-
the response
- getResponse ( ) ¶
-
- Returns
-
?\
Psr\ Http\ Message\ Response Interface
- getPageInformation ( ) ¶
-
- Returns
-
\TYPO3\
CMS\ Frontend\ Page\ Page Information
- setPageInformation ( \TYPO3\CMS\Frontend\Page\PageInformation $pageInformation) ¶
-
- param $pageInformation
-
the pageInformation
Migration¶
Use the method get
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
set
.
In case the middleware Typo
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.