protected function FormBase::config

protected FormBase::config($name)

Retrieves a configuration object.

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

$this->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 A configuration object.

File

core/lib/Drupal/Core/Form/FormBase.php, line 113

Class

FormBase
Provides a base class for forms.

Namespace

Drupal\Core\Form

Code

protected function config($name) {
  return $this->configFactory()->get($name);
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Form!FormBase.php/function/FormBase::config/8.1.x