FrontendTypoScript
final class \
This class contains the TypoScript set up by the PrepareTypoScriptFrontendRendering Frontend middleware. It can be accessed in content objects:
$frontendTypoScript = $request->getAttribute('frontend.typoscript');
Table of Contents
Methods
- __construct() : mixed
- getConfigArray() : array
- Array representation of getConfigTree().
- getConfigTree() : RootNode
- The merged TypoScript 'config.'.
- getFlatSettings() : array
- This is *always* set up by the middleware / factory: Current settings ("constants") are needed for page cache identifier calculation.
- getPageArray() : array
- Array representation of getPageTree().
- getPageTree() : RootNode
- The determined PAGE object from main TypoScript 'setup' that depends on type / typeNum.
- getSettingsConditionList() : array
- List of settings conditions with verdicts. Used internally for page cache identifier calculation.
- getSettingsTree() : RootNode
- The settings ("constants") AST.
- getSetupArray() : array
- The full Frontend TypoScript array.
- getSetupConditionList() : array
- List of setup conditions with verdicts. Used internally for page cache identifier calculation.
- getSetupIncludeTree() : RootInclude|null
- A tree of all TypoScript setup includes. Used internally within FrontendTypoScriptFactory to suppress calculating the include tree twice.
- getSetupTree() : RootNode
- hasPage() : bool
- hasSetup() : bool
- 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.
- setConfigArray() : void
- setConfigTree() : void
- setPageArray() : void
- setPageTree() : void
- setSetupArray() : void
- setSetupIncludeTree() : void
- setSetupTree() : void
Methods
__construct()
public
__construct(RootNode $settingsTree, array $settingsConditionList, array $flatSettings, array $setupConditionList) : mixed
Parameters
- $settingsTree : RootNode
- $settingsConditionList : array
- $flatSettings : array
- $setupConditionList : array
getConfigArray()
Array representation of getConfigTree().
public
getConfigArray() : array
Return values
arraygetConfigTree()
The merged TypoScript 'config.'.
public
getConfigTree() : RootNode
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
Internal for now until the AST API stabilized.
Return values
RootNodegetFlatSettings()
This is *always* set up by the middleware / factory: Current settings ("constants") are needed for page cache identifier calculation.
public
getFlatSettings() : array
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',
];
Return values
arraygetPageArray()
Array representation of getPageTree().
public
getPageArray() : array
Internal
Return values
arraygetPageTree()
The determined PAGE object from main TypoScript 'setup' that depends on type / typeNum.
public
getPageTree() : RootNode
This is used internally by RequestHandler for page generation. It is not set in full cached page scenarios without _INT object.
Internal
Return values
RootNodegetSettingsConditionList()
List of settings conditions with verdicts. Used internally for page cache identifier calculation.
public
getSettingsConditionList() : array
Internal
Return values
arraygetSettingsTree()
The settings ("constants") AST.
public
getSettingsTree() : RootNode
Internal
Internal for now until the AST API stabilized.
Return values
RootNodegetSetupArray()
The full Frontend TypoScript array.
public
getSetupArray() : 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.
Return values
arraygetSetupConditionList()
List of setup conditions with verdicts. Used internally for page cache identifier calculation.
public
getSetupConditionList() : array
Internal
Return values
arraygetSetupIncludeTree()
A tree of all TypoScript setup includes. Used internally within FrontendTypoScriptFactory to suppress calculating the include tree twice.
public
getSetupIncludeTree() : RootInclude|null
Internal
Return values
RootInclude|nullgetSetupTree()
public
getSetupTree() : RootNode
Internal
Internal for now until the AST API stabilized.
Return values
RootNodehasPage()
public
hasPage() : bool
Internal
Return values
boolhasSetup()
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.
public
hasSetup() : bool
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.
Internal
Return values
boolsetConfigArray()
public
setConfigArray(array $configArray) : void
Parameters
- $configArray : array
Internal
setConfigTree()
public
setConfigTree(RootNode $setupConfig) : void
Parameters
- $setupConfig : RootNode
Internal
setPageArray()
public
setPageArray(array $pageArray) : void
Parameters
- $pageArray : array
Internal
setPageTree()
public
setPageTree(RootNode $pageTree) : void
Parameters
- $pageTree : RootNode
Internal
setSetupArray()
public
setSetupArray(array $setupArray) : void
Parameters
- $setupArray : array
Internal
setSetupIncludeTree()
public
setSetupIncludeTree(RootInclude $setupIncludeTree) : void
Parameters
- $setupIncludeTree : RootInclude
Internal
setSetupTree()
public
setSetupTree(RootNode $setupTree) : void
Parameters
- $setupTree : RootNode
Internal