‪TYPO3CMS  ‪main
TYPO3\CMS\Frontend\Http\RequestHandler Class Reference
Inheritance diagram for TYPO3\CMS\Frontend\Http\RequestHandler:

Public Member Functions

 __construct (private readonly EventDispatcherInterface $eventDispatcher, private readonly ListenerProvider $listenerProvider, private readonly TimeTracker $timeTracker,)
 handle (ServerRequestInterface $request)

Protected Member Functions

 resetGlobalsToCurrentRequest (ServerRequestInterface $request)
 generatePageContent (TypoScriptFrontendController $controller, ServerRequestInterface $request)
 generatePageBodyContent (TypoScriptFrontendController $controller)
 processHtmlBasedRenderingSettings (TypoScriptFrontendController $controller, SiteLanguage $siteLanguage, ServerRequestInterface $request)
 stripIntObjectPlaceholder (&$searchString, &$intObjects)
 generateMetaTagHtml (array $metaTagTypoScript, ContentObjectRenderer $cObj)
 getPageRenderer ()
 addCssToPageRenderer (TypoScriptFrontendController $controller, string $cssStyles, bool $excludeFromConcatenation, string $inlineBlockName)
string generateHtmlTag (array $htmlTagAttributes, array $configuration, ContentObjectRenderer $cObj)
 generateHrefLangTags (TypoScriptFrontendController $controller, ServerRequestInterface $request)
 displayPreviewInfoMessage (TypoScriptFrontendController $controller)
 getLanguageService ()

Detailed Description

This is the main entry point of the TypoScript driven standard front-end.

"handle()" is called when all PSR-15 middlewares have been set up the PSR-7 ServerRequest object and the following things have been evaluated

  • ‪correct page ID, page type (typeNum), rootline, MP etc.
  • ‪info if is cached content already available
  • ‪proper language
  • ‪proper TypoScript which should be processed.

Then, this class is able to render the actual HTTP body part built via TypoScript. Here this is split into two parts:

  • ‪Everything included in <body>, done via page.10, page.20 etc.
  • ‪Everything around.

If the content has been built together within the cache (cache_pages), it is fetched directly, and any so-called "uncached" content is generated again.

Some further hooks allow to post-processing the content.

Then the right HTTP response headers are compiled together and sent as well.

Definition at line 68 of file RequestHandler.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Frontend\Http\RequestHandler::__construct ( private readonly EventDispatcherInterface  $eventDispatcher,
private readonly ListenerProvider  $listenerProvider,
private readonly TimeTracker  $timeTracker 

Definition at line 70 of file RequestHandler.php.

Member Function Documentation

◆ addCssToPageRenderer()

TYPO3\CMS\Frontend\Http\RequestHandler::addCssToPageRenderer ( TypoScriptFrontendController  $controller,
string  $cssStyles,
bool  $excludeFromConcatenation,
string  $inlineBlockName 

Adds inline CSS code, by respecting the inlineStyle2TempFile option

string$cssStyles‪the inline CSS styling
bool$excludeFromConcatenation‪option to see if it should be concatenated
string$inlineBlockName‪the block name to add it

Definition at line 859 of file RequestHandler.php.

References TYPO3\CMS\Frontend\Http\RequestHandler\getPageRenderer().

Referenced by TYPO3\CMS\Frontend\Http\RequestHandler\processHtmlBasedRenderingSettings().

◆ displayPreviewInfoMessage()

TYPO3\CMS\Frontend\Http\RequestHandler::displayPreviewInfoMessage ( TypoScriptFrontendController  $controller)

Include the preview block in case we're looking at a hidden page in the LIVE workspace

this method might get moved to a PSR-15 middleware at some point

Definition at line 950 of file RequestHandler.php.

References TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\getContext(), and TYPO3\CMS\Frontend\Http\RequestHandler\getLanguageService().

Referenced by TYPO3\CMS\Frontend\Http\RequestHandler\handle().

◆ generateHrefLangTags()

TYPO3\CMS\Frontend\Http\RequestHandler::generateHrefLangTags ( TypoScriptFrontendController  $controller,
ServerRequestInterface  $request 

◆ generateHtmlTag()

string TYPO3\CMS\Frontend\Http\RequestHandler::generateHtmlTag ( array  $htmlTagAttributes,
array  $configuration,
ContentObjectRenderer  $cObj 

Generates the <html> tag by evaluating TypoScript configuration, usually found via:

  • ‪Adding extra attributes in addition to pre-generated ones (e.g. "dir") config.htmlTag.attributes.no-js = 1 config.htmlTag.attributes.empty-attribute =
  • Adding one full string (no stdWrap!) to the "<html $htmlTagAttributes {config.htmlTag_setParams}>" tag config.htmlTag_setParams = string|"none"

    If config.htmlTag_setParams = none is set, even the pre-generated values are not added at all anymore.

  • ‪"config.htmlTag_stdWrap" always applies over the whole compiled tag.
array$htmlTagAttributes‪pre-generated attributes by doctype/direction etc. values.
array$configuration‪the TypoScript configuration "config." array
‪string the full <html> tag as string

Definition at line 897 of file RequestHandler.php.

Referenced by TYPO3\CMS\Frontend\Http\RequestHandler\processHtmlBasedRenderingSettings().

◆ generateMetaTagHtml()

TYPO3\CMS\Frontend\Http\RequestHandler::generateMetaTagHtml ( array  $metaTagTypoScript,
ContentObjectRenderer  $cObj 

Generate meta tags from meta tag TypoScript

array$metaTagTypoScript‪TypoScript configuration for meta tags (e.g. $GLOBALS['TSFE']->pSetup['meta.'])

Definition at line 806 of file RequestHandler.php.

References TYPO3\CMS\Frontend\Http\RequestHandler\getPageRenderer().

Referenced by TYPO3\CMS\Frontend\Http\RequestHandler\processHtmlBasedRenderingSettings().

◆ generatePageBodyContent()

TYPO3\CMS\Frontend\Http\RequestHandler::generatePageBodyContent ( TypoScriptFrontendController  $controller)

Generates the main content part within <body> tags (except JS files/CSS files), this means: render everything that can be cached, otherwise put placeholders for COA_INT/USER_INT objects in the content that is processed later-on.

Definition at line 200 of file RequestHandler.php.

Referenced by TYPO3\CMS\Frontend\Http\RequestHandler\generatePageContent().

◆ generatePageContent()

TYPO3\CMS\Frontend\Http\RequestHandler::generatePageContent ( TypoScriptFrontendController  $controller,
ServerRequestInterface  $request 

Generates the main body part for the page, and if "config.disableAllHeaderCode" is not active, triggers pageRenderer to evaluate includeCSS, headTag etc. TypoScript processing to populate the pageRenderer.

Definition at line 169 of file RequestHandler.php.

References TYPO3\CMS\Frontend\Http\RequestHandler\generatePageBodyContent(), TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\getLanguage(), TYPO3\CMS\Frontend\Http\RequestHandler\getPageRenderer(), TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\isINTincScript(), and TYPO3\CMS\Frontend\Http\RequestHandler\processHtmlBasedRenderingSettings().

Referenced by TYPO3\CMS\Frontend\Http\RequestHandler\handle().

◆ getLanguageService()

TYPO3\CMS\Frontend\Http\RequestHandler::getLanguageService ( )

◆ getPageRenderer()

◆ handle()

TYPO3\CMS\Frontend\Http\RequestHandler::handle ( ServerRequestInterface  $request)

◆ processHtmlBasedRenderingSettings()

TYPO3\CMS\Frontend\Http\RequestHandler::processHtmlBasedRenderingSettings ( TypoScriptFrontendController  $controller,
SiteLanguage  $siteLanguage,
ServerRequestInterface  $request 

◆ resetGlobalsToCurrentRequest()

TYPO3\CMS\Frontend\Http\RequestHandler::resetGlobalsToCurrentRequest ( ServerRequestInterface  $request)

Sets the global GET and POST to the values, so if people access $_GET and $_POST Within hooks starting NOW (e.g. cObject), they get the "enriched" data from query params.

This needs to be run after the request object has been enriched with modified GET/POST variables.


this safety net will be removed in TYPO3 v10.0.

Definition at line 86 of file RequestHandler.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Frontend\Http\RequestHandler\handle().

◆ stripIntObjectPlaceholder()

TYPO3\CMS\Frontend\Http\RequestHandler::stripIntObjectPlaceholder ( $searchString,

Searches for placeholder created from *_INT cObjects, removes them from $searchString and merges them to $intObjects

string$searchString‪The String which should be cleaned from int-object markers
string$intObjects‪The String the found int-placeholders are moved to (for further processing)

Definition at line 793 of file RequestHandler.php.

Referenced by TYPO3\CMS\Frontend\Http\RequestHandler\processHtmlBasedRenderingSettings().