‪TYPO3CMS  ‪main
TYPO3\CMS\Frontend\Event\ModifyTypoScriptConfigEvent Class Reference

Public Member Functions

 __construct (private readonly ServerRequestInterface $request, private readonly RootNode $setupTree, private RootNode $configTree,)
 getRequest ()
 getSetupTree ()
 getConfigTree ()
 setConfigTree (RootNode $configTree)

Detailed Description

This event allows listeners to adjust and react on TypoScript 'config'.

This event is dispatched before final TypoScript 'config' is written to cache, and not when a page can be successfully retrieved from cache, which is typically the case in 'page is fully cached' scenarios.

This incoming $configTree has already been merged with the determined PAGE "page.config" TypoScript of the requested 'type' / 'typeNum' and the global TypoScript setup 'config'.

The result of this event is available as Request attribute: $request->getAttribute('frontend.typoscript')->getConfigTree(), and its array variant $request->getAttribute('frontend.typoscript')->getConfigArray().

Registered listener can set a modified setup config AST. Note the TypoScript AST structure is still marked

within v13 core and may change later, using the event to write different 'config' data is thus still a bit risky.

Definition at line 42 of file ModifyTypoScriptConfigEvent.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Frontend\Event\ModifyTypoScriptConfigEvent::__construct ( private readonly ServerRequestInterface  $request,
private readonly RootNode  $setupTree,
private RootNode  $configTree 

Definition at line 44 of file ModifyTypoScriptConfigEvent.php.

Member Function Documentation

◆ getConfigTree()

TYPO3\CMS\Frontend\Event\ModifyTypoScriptConfigEvent::getConfigTree ( )

Definition at line 60 of file ModifyTypoScriptConfigEvent.php.

◆ getRequest()

TYPO3\CMS\Frontend\Event\ModifyTypoScriptConfigEvent::getRequest ( )

Definition at line 50 of file ModifyTypoScriptConfigEvent.php.

◆ getSetupTree()

TYPO3\CMS\Frontend\Event\ModifyTypoScriptConfigEvent::getSetupTree ( )

Definition at line 55 of file ModifyTypoScriptConfigEvent.php.

◆ setConfigTree()

TYPO3\CMS\Frontend\Event\ModifyTypoScriptConfigEvent::setConfigTree ( RootNode  $configTree)

Definition at line 65 of file ModifyTypoScriptConfigEvent.php.