Feature: #99048 - Site settings read API
See forge#99048
Description
Settings for site-specific functionality can now be retrieved by a dedicated
\TYPO3\
object, accessible via a
\TYPO3\
object like $site->get
.
Settings can be used in custom frontend code to deliver features which might vary per-site for extensions.
Impact
Accessing site settings, which was previously possible via:
$site->get
in custom PHP code, is now easier via the Site
PHP object.
The Site
object can be used to access settings either by
the dot notation ("flat", a default value can be given as optional second
argument), e.g.:
$redirectStatusCode = (int)$siteSettings->get('redirects.httpStatusCode', 307);
or by accessing all options for a certain group:
$allSettingsRelatedToRedirects = $siteSettings->get('redirects');
or even fetching all settings:
$allSettings = $siteSettings->all();
In addition, settings can now be accessed in TypoScript via get
with the key site
:
page.10 = TEXT
page.10.data = siteSettings:redirects.httpStatusCode