Import config file programmatically on Drupal 9 | Drupal 8

Import config file programmatically on Drupal 9

Submitted by editor on Fri, 08/13/2021 - 09:40

Import configuration file programmatically on Drupal 9 using config_update contrib module and service

//Update Module settings
\Drupal::service('config_update.config_update')->revert('system.simple', 'mymodule.settings');

// Import a block.
\Drupal::service('config_update.config_update')->import('block', 'mycustomblock');

Add new comment

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.