1 config.api.php hook_config_create(Config $staging_config)

Respond to configuration creation.

Parameters

Config $staging_config: The configuration object for the settings about to be saved. This object is always passed by reference and may be modified to adjust the settings that are saved.

Related topics

File

core/modules/config/config.api.php, line 168
Documentation for hooks provided by Config module.

Code

function hook_config_create(Config $staging_config) {
  if (strpos($staging_config->getName(), 'image.style') === 0) {
    // Set a value before the config is saved.
    $staging_config->set('some_key', 'default');
  }
}