SiteConfigurationBeforeWriteEvent

New in version 12.0: The events SiteConfigurationLoadedEvent and SiteConfigurationBeforeWriteEvent have been introduced.

This event allows modification of the site configuration array before before writing the configuration to disk.

Note

If you need to change the configuration when it is loaded, use SiteConfigurationLoadedEvent.

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\SiteConfigurationBeforeWriteListener:
     tags:
       - name: event.listener
         identifier: 'myWriteListener'

API

class TYPO3\CMS\Core\Configuration\Event\SiteConfigurationBeforeWriteEvent

Event fired before a site configuration is written to a yaml file allows dynamic modification of the site's configuration before writing.

getSiteIdentifier()
Return type

string

getConfiguration()
Return type

array

setConfiguration(array $configuration)
Parameters
  • $configuration (array) -- overwrite the configuration array of the site