Created
February 14, 2017 04:12
-
-
Save yusufhm/875338b94baa2f81c05bde034c49abb3 to your computer and use it in GitHub Desktop.
drupal 8 import config programmatically
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// The following snippet updates the filter format configuration. | |
$config_path = drupal_get_path('module', 'my_custom_module') . '/config/install'; // or any path containing config files theoretically. | |
$source = new FileStorage($config_path); | |
$config_storage = \Drupal::service('config.storage'); | |
$config_storage->write('filter.format.basic_html', $source->read('filter.format.basic_html')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment