You are here

public function Config::importModule in Helper 8

Import a module's directory containing configuration files.

Parameters

string $module: The module name.

string $directory: The directory name inside the module's config directory. Defaults to 'install'.

array $options: An array of options to pass to file_scan_directory().

Throws

\RuntimeException If unable to decode YAML from file.

\Drupal\Core\Entity\EntityStorageException In unable to save the config.

File

src/Config.php, line 148

Class

Config
Provides helper for working with configuration.

Namespace

Drupal\helper

Code

public function importModule($module, $directory = 'install', array $options = []) {
  $this
    ->importDirectory(drupal_get_path('module', $module) . '/config/' . $directory, $options);
}