public static function Drupal::config

Retrieves a configuration object.

This is the main entry point to the configuration API. Calling

Drupal::config('book.admin');

will return a configuration object in which the book module can store its administrative settings.

Parameters

string $name: The name of the configuration object to retrieve. The name corresponds to a configuration file. For

config('book.admin');

, the config object returned will contain the contents of book.admin configuration file.

Return value

\Drupal\Core\Config\Config A configuration object.

5 calls to Drupal::config()
datetime_form_node_form_alter in drupal/core/modules/datetime/datetime.module
Implements hook_form_BASE_FORM_ID_alter() for node forms.
system_theme_settings_submit in drupal/core/modules/system/system.admin.inc
Process system_theme_settings form submissions.
system_update_8055 in drupal/core/modules/system/system.install
Move system theme settings from variables to config.
update_7_to_8_install_default_config in drupal/core/includes/update.inc
Installs a default configuration file into the active store.
_drupal_maintenance_theme in drupal/core/includes/theme.maintenance.inc
Sets up the theming system for maintenance page.

File

drupal/core/lib/Drupal.php, line 221
Contains Drupal.

Class

Drupal
Static Service Container wrapper.

Code

public static function config($name) {
  return static::$container
    ->get('config.factory')
    ->get($name);
}