function Container::getParameter

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Component/DependencyInjection/Container.php \Drupal\Component\DependencyInjection\Container::getParameter()
  2. 10 core/lib/Drupal/Component/DependencyInjection/Container.php \Drupal\Component\DependencyInjection\Container::getParameter()

File

core/lib/Drupal/Component/DependencyInjection/Container.php, line 322

Class

Container
Provides a container optimized for Drupal's needs.

Namespace

Drupal\Component\DependencyInjection

Code

public function getParameter($name) {
  if (!(isset($this->parameters[$name]) || array_key_exists($name, $this->parameters))) {
    if (!$name) {
      throw new ParameterNotFoundException('');
    }
    throw new ParameterNotFoundException($name, NULL, NULL, NULL, $this->getParameterAlternatives($name));
  }
  return $this->parameters[$name];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.