SiteConfigurationLoadedEvent¶
New in version 12.0: The events SiteConfigurationLoadedEvent and SiteConfigurationBeforeWriteEvent have been introduced.
This event allows modification of the site configuration array before loading the configuration.
Note
If you need to change the configuration before it is saved to disk, use SiteConfigurationBeforeWriteEvent.
Example¶
To register an event listener to the new events, use the following code in your
Services.yaml
:
EXT:my_extension/Configuration/Services.yaml¶
services:
MyVendor\MyExtension\EventListener\SiteConfigurationLoadedListener:
tags:
- name: event.listener
identifier: 'myLoadedListener'
API¶
- class TYPO3\CMS\Core\Configuration\Event\SiteConfigurationLoadedEvent¶
Event after a site configuration has been read from a yaml file before it is cached - allows dynamic modification of the site's configuration.
- getSiteIdentifier()¶
- Return type
string
- getConfiguration()¶
- Return type
array
- setConfiguration(array $configuration)¶
- Parameters
$configuration (
array
) -- overwrite the configuration array of the site