thierry-b
6/8/2017 - 2:30 PM

Tip: Import features configuration into drupal

Tip: Import features configuration into drupal

<?php
  $config_storage = \Drupal::service('config.storage');
  $config_path = drupal_get_path('module', 'feature_name') . '/config/install';
  $source = new FileStorage($config_path);
  // Wrap the next line in a foreach loop parsing your configuration files
  // located in $config_storage, and importing it.
  // file_name and config_name are identicals. Do not add the .yml part of the
  // filename.
  $config_storage->write('file_name', $source->read('config_name'));