Skip to content

Instantly share code, notes, and snippets.

@xtfer
Created April 29, 2015 04:09
Show Gist options
  • Save xtfer/6f601c608154d32803b1 to your computer and use it in GitHub Desktop.
Save xtfer/6f601c608154d32803b1 to your computer and use it in GitHub Desktop.
Config module usage
<?php
// Load the Config class.
$config = \Drupal\config\Config::load();
// Supports JSON, PHP, and optionally YAML. Want XML? Its extensible.
$parser_type = CONFIG_PARSER_JSON;
// Get the Config.
return $config->getConfig('my_module_name', 'directory_within_module', 'file_within_directory.ext', $parser_type);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment