1 config.api.php hook_config_update(Config $staging_config, Config $active_config)
1 config_test_hooks.module hook_config_update(Config $staging_config, Config $active_config)

Implements hook_config_update().

File

core/modules/config/tests/config_test_hooks/config_test_hooks.module, line 59
Tests the hooks provided by Configuration management module.

Code

function hook_config_update(Config $staging_config, Config $active_config) {
  if ($staging_config->getName() === 'config_test.new_config') {
    // Set a value before the config is saved.
    $staging_config->set('favorite_animal', 'cats');
  }
}