‪TYPO3CMS  ‪main
TYPO3\CMS\Core\TypoScript\FrontendTypoScript Class Reference

Public Member Functions

 __construct (private readonly RootNode $settingsTree, private readonly array $settingsConditionList, private readonly array $flatSettings, private readonly array $setupConditionList,)
 
 getSettingsTree ()
 
 getSettingsConditionList ()
 
 getFlatSettings ()
 
 getSetupConditionList ()
 
 setSetupIncludeTree (RootInclude $setupIncludeTree)
 
 getSetupIncludeTree ()
 
 setSetupTree (RootNode $setupTree)
 
 hasSetup ()
 
 getSetupTree ()
 
 setSetupArray (array $setupArray)
 
 getSetupArray ()
 
 setConfigTree (RootNode $setupConfig)
 
 getConfigTree ()
 
 setConfigArray (array $configArray)
 
 getConfigArray ()
 
 setPageTree (RootNode $pageTree)
 
 getPageTree ()
 
 hasPage ()
 
 setPageArray (array $pageArray)
 
 getPageArray ()
 

Private Attributes

RootInclude $setupIncludeTree = null
 
RootNode $setupTree = null
 
array $setupArray = null
 
RootNode $configTree = null
 
array $configArray = null
 
RootNode $pageTree = null
 
array $pageArray = null
 

Detailed Description

This class contains the TypoScript set up by the PrepareTypoScriptFrontendRendering Frontend middleware. It can be accessed in content objects:

$frontendTypoScript = $request->getAttribute('frontend.typoscript');

Definition at line 29 of file FrontendTypoScript.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\TypoScript\FrontendTypoScript::__construct ( private readonly RootNode  $settingsTree,
private readonly array  $settingsConditionList,
private readonly array  $flatSettings,
private readonly array  $setupConditionList 
)

Definition at line 39 of file FrontendTypoScript.php.

Member Function Documentation

◆ getConfigArray()

TYPO3\CMS\Core\TypoScript\FrontendTypoScript::getConfigArray ( )

Array representation of getConfigTree().

Definition at line 234 of file FrontendTypoScript.php.

References TYPO3\CMS\Core\TypoScript\FrontendTypoScript\$configArray.

◆ getConfigTree()

TYPO3\CMS\Core\TypoScript\FrontendTypoScript::getConfigTree ( )

The merged TypoScript 'config.'.

This is the result of the "global" TypoScript 'config' section, merged with the 'config' section of the determined PAGE object which can override "global" 'config' per type / typeNum.

This is always needed within casual Frontend rendering by FrontendTypoScriptFactory and has a dedicated cache layer to be quick to retrieve. It is needed even in fully cached pages context to for instance know if debug headers should be added ("config.debug=1") to a response.

Internal for now until the AST API stabilized.

Definition at line 212 of file FrontendTypoScript.php.

References TYPO3\CMS\Core\TypoScript\FrontendTypoScript\$configTree.

◆ getFlatSettings()

TYPO3\CMS\Core\TypoScript\FrontendTypoScript::getFlatSettings ( )

This is always set up by the middleware / factory: Current settings ("constants") are needed for page cache identifier calculation. This is a "flattened" array of all settings, as example, consider these settings TypoScript:

mySettings {
foo = fooValue
bar = barValue
}

This will result in this array:

$flatSettings = [
'mySettings.foo' => 'fooValue',
'mySettings.bar' => 'barValue',
];

Definition at line 88 of file FrontendTypoScript.php.

◆ getPageArray()

TYPO3\CMS\Core\TypoScript\FrontendTypoScript::getPageArray ( )

Array representation of getPageTree().

Definition at line 296 of file FrontendTypoScript.php.

References TYPO3\CMS\Core\TypoScript\FrontendTypoScript\$pageArray.

◆ getPageTree()

TYPO3\CMS\Core\TypoScript\FrontendTypoScript::getPageTree ( )

The determined PAGE object from main TypoScript 'setup' that depends on type / typeNum.

This is used internally by RequestHandler for page generation. It is not set in full cached page scenarios without _INT object.

Definition at line 262 of file FrontendTypoScript.php.

References TYPO3\CMS\Core\TypoScript\FrontendTypoScript\$pageTree.

◆ getSettingsConditionList()

TYPO3\CMS\Core\TypoScript\FrontendTypoScript::getSettingsConditionList ( )

List of settings conditions with verdicts. Used internally for page cache identifier calculation.

Definition at line 62 of file FrontendTypoScript.php.

Referenced by TYPO3\CMS\Frontend\Middleware\PrepareTypoScriptFrontendRendering\createPageCacheIdentifier().

◆ getSettingsTree()

TYPO3\CMS\Core\TypoScript\FrontendTypoScript::getSettingsTree ( )

The settings ("constants") AST.

Internal for now until the AST API stabilized.

Definition at line 51 of file FrontendTypoScript.php.

◆ getSetupArray()

TYPO3\CMS\Core\TypoScript\FrontendTypoScript::getSetupArray ( )

The full Frontend TypoScript array.

This is always set up as soon as the Frontend rendering needs to actually render something and can not get the full content from page cache. This is the case when a page cache entry does not exist, or when the page contains COA_INT or USER_INT objects.

Definition at line 179 of file FrontendTypoScript.php.

References TYPO3\CMS\Core\TypoScript\FrontendTypoScript\$setupArray.

◆ getSetupConditionList()

TYPO3\CMS\Core\TypoScript\FrontendTypoScript::getSetupConditionList ( )

List of setup conditions with verdicts. Used internally for page cache identifier calculation.

Definition at line 99 of file FrontendTypoScript.php.

Referenced by TYPO3\CMS\Frontend\Middleware\PrepareTypoScriptFrontendRendering\createPageCacheIdentifier().

◆ getSetupIncludeTree()

TYPO3\CMS\Core\TypoScript\FrontendTypoScript::getSetupIncludeTree ( )

A tree of all TypoScript setup includes. Used internally within FrontendTypoScriptFactory to suppress calculating the include tree twice.

Definition at line 119 of file FrontendTypoScript.php.

References TYPO3\CMS\Core\TypoScript\FrontendTypoScript\$setupIncludeTree.

◆ getSetupTree()

TYPO3\CMS\Core\TypoScript\FrontendTypoScript::getSetupTree ( )

Internal for now until the AST API stabilized.

Definition at line 152 of file FrontendTypoScript.php.

References TYPO3\CMS\Core\TypoScript\FrontendTypoScript\$setupTree.

◆ hasPage()

TYPO3\CMS\Core\TypoScript\FrontendTypoScript::hasPage ( )

Definition at line 278 of file FrontendTypoScript.php.

◆ hasSetup()

TYPO3\CMS\Core\TypoScript\FrontendTypoScript::hasSetup ( )

When a page is retrieved from cache and does not contain COA_INT or USER_INT objects, Frontend TypoScript setup is not calculated, AST and the array representation aren't set. Calling getSetupTree() or getSetupArray() will then throw an exception.

To avoid the exception, consumers can call hasSetup() beforehand.

Note casual content objects do not need to do this, since setup TypoScript is always set up when content objects need to be calculated.

Definition at line 144 of file FrontendTypoScript.php.

◆ setConfigArray()

TYPO3\CMS\Core\TypoScript\FrontendTypoScript::setConfigArray ( array  $configArray)

◆ setConfigTree()

TYPO3\CMS\Core\TypoScript\FrontendTypoScript::setConfigTree ( RootNode  $setupConfig)

Definition at line 194 of file FrontendTypoScript.php.

◆ setPageArray()

TYPO3\CMS\Core\TypoScript\FrontendTypoScript::setPageArray ( array  $pageArray)

◆ setPageTree()

TYPO3\CMS\Core\TypoScript\FrontendTypoScript::setPageTree ( RootNode  $pageTree)

◆ setSetupArray()

TYPO3\CMS\Core\TypoScript\FrontendTypoScript::setSetupArray ( array  $setupArray)

◆ setSetupIncludeTree()

TYPO3\CMS\Core\TypoScript\FrontendTypoScript::setSetupIncludeTree ( RootInclude  $setupIncludeTree)

◆ setSetupTree()

TYPO3\CMS\Core\TypoScript\FrontendTypoScript::setSetupTree ( RootNode  $setupTree)

Member Data Documentation

◆ $configArray

array TYPO3\CMS\Core\TypoScript\FrontendTypoScript::$configArray = null
private

◆ $configTree

RootNode TYPO3\CMS\Core\TypoScript\FrontendTypoScript::$configTree = null
private

◆ $pageArray

array TYPO3\CMS\Core\TypoScript\FrontendTypoScript::$pageArray = null
private

◆ $pageTree

RootNode TYPO3\CMS\Core\TypoScript\FrontendTypoScript::$pageTree = null
private

◆ $setupArray

array TYPO3\CMS\Core\TypoScript\FrontendTypoScript::$setupArray = null
private

◆ $setupIncludeTree

RootInclude TYPO3\CMS\Core\TypoScript\FrontendTypoScript::$setupIncludeTree = null
private

◆ $setupTree

RootNode TYPO3\CMS\Core\TypoScript\FrontendTypoScript::$setupTree = null
private