Frontend TypoScript
New in version 12.1
This request attribute obsoletes the usage of
\TYPO3\
.
The frontend.
frontend request attribute provides access to the
\TYPO3\
object. It contains
the calculated TypoScript settings
(formerly constants
) and
sometimes setup
, depending on page cache status.
When a content object or plugin (plugins are content objects as well) needs the current TypoScript, it can retrieve it using this API:
// Substitution of $GLOBALS['TSFE']->tmpl->setup
$fullTypoScript = $request->getAttribute('frontend.typoscript')
->getSetupArray();
API
New in version 13.0
The method get
has been added. This supersedes the
TSFE->config
array.
- class FrontendTypoScript
-
- Fully qualified name
-
\TYPO3\
CMS\ Core\ Typo Script\ Frontend Typo Script
This class contains the TypoScript set up by the PrepareTypoScriptFrontendRendering Frontend middleware. It can be accessed in content objects:
$frontendTypoScript = $request->getAttribute('frontend.typoscript');
- 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 }
Copied!This will result in this array:
$flatSettings = [ 'mySettings.foo' => 'fooValue', 'mySettings.bar' => 'barValue', ];
Copied!- Returns
-
array
- 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.
- Returns
-
array