FrontendTypoScript
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<string|int, mixed>
- Array representation of getConfigTree().
- getConfigTree() : RootNode
- The merged TypoScript 'config.'.
- getFlatSettings() : array<string|int, mixed>
- This is *always* set up by the middleware / factory: Current settings ("constants") are needed for page cache identifier calculation.
- getPageArray() : array<string|int, mixed>
- Array representation of getPageTree().
- getPageTree() : RootNode
- The determined PAGE object from main TypoScript 'setup' that depends on type / typeNum.
- getSettingsConditionList() : array<string|int, mixed>
- List of settings conditions with verdicts. Used internally for page cache identifier calculation.
- getSettingsTree() : RootNode
- The settings ("constants") AST.
- getSetupArray() : array<string|int, mixed>
- The full Frontend TypoScript array.
- getSetupConditionList() : array<string|int, mixed>
- 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<string|int, mixed> $settingsConditionList, array<string|int, mixed> $flatSettings, array<string|int, mixed> $setupConditionList) : mixed
Parameters
- $settingsTree : RootNode
- $settingsConditionList : array<string|int, mixed>
- $flatSettings : array<string|int, mixed>
- $setupConditionList : array<string|int, mixed>
getConfigArray()
Array representation of getConfigTree().
public
getConfigArray() : array<string|int, mixed>
Return values
array<string|int, mixed>getConfigTree()
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 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<string|int, mixed>
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
array<string|int, mixed>getPageArray()
Array representation of getPageTree().
public
getPageArray() : array<string|int, mixed>
Return values
array<string|int, mixed>getPageTree()
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.
Return values
RootNodegetSettingsConditionList()
List of settings conditions with verdicts. Used internally for page cache identifier calculation.
public
getSettingsConditionList() : array<string|int, mixed>
Return values
array<string|int, mixed>getSettingsTree()
The settings ("constants") AST.
public
getSettingsTree() : RootNode
Internal for now until the AST API stabilized.
Return values
RootNodegetSetupArray()
The full Frontend TypoScript array.
public
getSetupArray() : array<string|int, mixed>
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
array<string|int, mixed>getSetupConditionList()
List of setup conditions with verdicts. Used internally for page cache identifier calculation.
public
getSetupConditionList() : array<string|int, mixed>
Return values
array<string|int, mixed>getSetupIncludeTree()
A tree of all TypoScript setup includes. Used internally within FrontendTypoScriptFactory to suppress calculating the include tree twice.
public
getSetupIncludeTree() : RootInclude|null
Return values
RootInclude|nullgetSetupTree()
public
getSetupTree() : RootNode
Internal for now until the AST API stabilized.
Return values
RootNodehasPage()
public
hasPage() : bool
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.
Return values
boolsetConfigArray()
public
setConfigArray(array<string|int, mixed> $configArray) : void
Parameters
- $configArray : array<string|int, mixed>
setConfigTree()
public
setConfigTree(RootNode $setupConfig) : void
Parameters
- $setupConfig : RootNode
setPageArray()
public
setPageArray(array<string|int, mixed> $pageArray) : void
Parameters
- $pageArray : array<string|int, mixed>
setPageTree()
public
setPageTree(RootNode $pageTree) : void
Parameters
- $pageTree : RootNode
setSetupArray()
public
setSetupArray(array<string|int, mixed> $setupArray) : void
Parameters
- $setupArray : array<string|int, mixed>
setSetupIncludeTree()
public
setSetupIncludeTree(RootInclude $setupIncludeTree) : void
Parameters
- $setupIncludeTree : RootInclude
setSetupTree()
public
setSetupTree(RootNode $setupTree) : void
Parameters
- $setupTree : RootNode