W3cubDocs

/Drupal 8

protected function FormBase::configFactory

protected FormBase::configFactory()

Gets the config factory for this form.

When accessing configuration values, use $this->config(). Only use this when the config factory needs to be manipulated directly.

Return value

\Drupal\Core\Config\ConfigFactoryInterface

File

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

Class

FormBase
Provides a base class for forms.

Namespace

Drupal\Core\Form

Code

protected function configFactory() {
  if (!$this->configFactory) {
    $this->configFactory = $this->container()->get('config.factory');
  }
  return $this->configFactory;
}

© 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::configFactory/8.1.x