public function ConfigFactory::get

Returns a configuration object for a given name and context.

Parameters

string $name: The name of the configuration object to construct.

Return value

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

File

drupal/core/lib/Drupal/Core/Config/ConfigFactory.php, line 76
Definition of Drupal\Core\Config\ConfigFactory.

Class

ConfigFactory
Defines the configuration object factory.

Namespace

Drupal\Core\Config

Code

public function get($name) {
  $context = $this
    ->getContext();
  $cache_key = $this
    ->getCacheKey($name, $context);
  if (isset($this->cache[$cache_key])) {
    return $this->cache[$cache_key];
  }
  $this->cache[$cache_key] = new Config($name, $this->storage, $context);
  return $this->cache[$cache_key]
    ->init();
}