You are here

public static function Drupal::config in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal.php \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

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

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

Return value

\Drupal\Core\Config\ImmutableConfig An immutable configuration object.

39 calls to Drupal::config()
AccountForm::form in core/modules/user/src/AccountForm.php
Gets the actual form array to be built.
automated_cron_form_system_cron_settings_alter in core/modules/automated_cron/automated_cron.module
Implements hook_form_FORM_ID_alter() for the system_cron_settings() form.
ConfigInstallWebTest::testIntegrationModuleReinstallation in core/modules/config/src/Tests/ConfigInstallWebTest.php
Tests module re-installation.
ConfigLanguageOverrideTest::testConfigLanguageOverride in core/modules/config/src/Tests/ConfigLanguageOverrideTest.php
Tests locale override based on language.
ConfigOverrideTest::testConfOverride in core/modules/config/src/Tests/ConfigOverrideTest.php
Tests configuration override.

... See full list

File

core/lib/Drupal.php, line 341
Contains \Drupal.

Class

Drupal
Static Service Container wrapper.

Code

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