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

$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.

137 calls to config()
AccountFormController::form in drupal/core/modules/user/lib/Drupal/user/AccountFormController.php
Overrides Drupal\Core\Entity\EntityFormController::form().
AggregatorRenderingTest::testFeedPage in drupal/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorRenderingTest.php
Create a feed and check that feed's page.
aggregator_admin_form_submit in drupal/core/modules/aggregator/aggregator.admin.inc
Form submission handler for aggregator_admin_form().
aggregator_form_aggregator_admin_form_alter in drupal/core/modules/aggregator/aggregator.processor.inc
Implements hook_form_aggregator_admin_form_alter().
aggregator_page_rss in drupal/core/modules/aggregator/aggregator.pages.inc
Page callback: Generates an RSS 0.92 feed of aggregator items or categories.

... See full list

6 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
CoreBundle::build in drupal/core/lib/Drupal/Core/CoreBundle.php
Implements \Symfony\Component\HttpKernel\Bundle\BundleInterface::build().
DatabaseStorageTest::setUp in drupal/core/modules/config/lib/Drupal/config/Tests/Storage/DatabaseStorageTest.php
Sets up Drupal unit test environment.
system_cache_flush in drupal/core/modules/system/system.module
Implements hook_cache_flush().

... See full list

File

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

Code

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