function config

Retrieves a configuration object.

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

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.

153 calls to config()
AccountFormController::form in drupal/core/modules/user/lib/Drupal/user/AccountFormController.php
Overrides Drupal\Core\Entity\EntityFormController::form().
aggregator_page_rss in drupal/core/modules/aggregator/aggregator.pages.inc
Page callback: Generates an RSS 0.92 feed of aggregator items or categories.
aggregator_refresh in drupal/core/modules/aggregator/aggregator.module
Checks a news feed for new items.
bartik_process_maintenance_page in drupal/core/themes/bartik/bartik.theme
Implements hook_process_HOOK() for maintenance-page.html.twig.
bartik_process_page in drupal/core/themes/bartik/bartik.theme
Implements hook_process_HOOK() for page.html.twig.

... See full list

8 string references to 'config'
ConfigDataCollector::getName in drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php
Returns the name of the collector.
ConfigDataCollectorTest::testCollect in drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DataCollector/ConfigDataCollectorTest.php
core.services.yml in drupal/core/core.services.yml
drupal/core/core.services.yml
DatabaseStorageTest::setUp in drupal/core/modules/config/lib/Drupal/config/Tests/Storage/DatabaseStorageTest.php
Sets up Drupal unit test environment.
install_begin_request in drupal/core/includes/install.core.inc
Begins an installation request, modifying the installation state as needed.

... See full list

File

drupal/core/includes/config.inc, line 83
This is the API for configuration storage.

Code

function config($name) {
  return drupal_container()
    ->get('config.factory')
    ->get($name);
}