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
- getFlatSettings() : array
- This is *always* set up by the middleware: Current settings (aka "TypoScript constants") are needed for page cache identifier calculation.
- getSettingsTree() : RootNode
- getSetupArray() : array
- The full Frontend TypoScript array.
- getSetupTree() : RootNode
- 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, so the AST and the array are not set.
- setSetupArray() : void
- setSetupTree() : void
Methods
__construct()
public
__construct(RootNode $settingsTree, array $flatSettings) : mixed
Parameters
- $settingsTree : RootNode
- $flatSettings : array
getFlatSettings()
This is *always* set up by the middleware: Current settings (aka "TypoScript 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
arraygetSettingsTree()
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
arraygetSetupTree()
public
getSetupTree() : RootNode
Internal
Internal for now until the AST API stabilized.
Return values
RootNodehasSetup()
When a page is retrieved from cache and does not contain COA_INT or USER_INT objects, Frontend TypoScript setup is not calculated, so the AST and the array are not 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
boolsetSetupArray()
public
setSetupArray(array $setupArray) : void
Parameters
- $setupArray : array
Internal
setSetupTree()
public
setSetupTree(RootNode $setupTree) : void
Parameters
- $setupTree : RootNode
Internal