Skip to content

Instantly share code, notes, and snippets.

@kerasai
Created January 4, 2019 19:05
Show Gist options
  • Save kerasai/654d9600002267bf0238b9119b214917 to your computer and use it in GitHub Desktop.
Save kerasai/654d9600002267bf0238b9119b214917 to your computer and use it in GitHub Desktop.
Install configuration from YML
<?php
/** @var \Drupal\Core\Config\StorageInterface $config_storage */
$config_storage = \Drupal::service('config.storage');
$path = drupal_get_path('module', 'module_name') . '/config/install';
$file_storage = new \Drupal\Core\Config\FileStorage($path);
$id = 'full.config.identifier';
$config_storage->write($id, $file_storage->read($id));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment