Frontend page information

New in version 13.0

The frontend.page.information frontend request attribute provides frequently used page information. The attribute is attached to the PSR-7 frontend request by the middleware TypoScriptFrontendInitialization, middlewares below can rely on existence of that attribute.

/** @var \TYPO3\CMS\Frontend\Page\PageInformation $pageInformation */
$pageInformation = $request->getAttribute('frontend.page.information');

// Formerly $tsfe->id
$id = $pageInformation->getId();

// Formerly $tsfe->page
$page = $pageInformation->getPageRecord();

// Formerly $tsfe->rootLine
$rootLine = $pageInformation->getRootLine();

// Formerly $tsfe->config['rootLine']
$rootLine = $pageInformation->getLocalRootLine();
Copied!