Feature: #102715 - New frontend.page.information request attribute¶
See forge#102715
Description¶
TYPO3 v13 introduces the new frontend-related PSR-7 request attribute frontend.page.information
implemented by class \TYPO3\CMS\Frontend\Page\PageInformation
. The object aims to replace
various page related properties of \TYPO3\CMS\Frontend\Controller\TyposcriptFrontendController
.
Note the class is currently still marked as experimental. Extension authors are however encouraged
to use information from this request attribute instead of the TyposcriptFrontendController
properties already: TYPO3 Core v13 will try to not break especially the getters / properties not
marked as @internal
.
Impact¶
There are three properties in TyposcriptFrontendController
frequently used by extensions,
which are now modeled in \TYPO3\CMS\Frontend\Page\PageInformation
. The attribute is
attached to the PSR-7 frontend request by middleware TypoScriptFrontendInitialization
,
middlewares below can rely on existence of that attribute. Examples:
$pageInformation = $request->getAttribute('frontend.page.information');
// Formerly $tsfe->id
$id = $pageInformation->getId();
// Formerly $tsfe->page
$page = $pageInformation->getPageRecord();
// Formerly $tsfe->rootLine
$rootLine = $pageInformation->getRootLine();