You are here

protected function FormBase::config in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Form/FormBase.php \Drupal\Core\Form\FormBase::config()
  2. 9 core/lib/Drupal/Core/Form/FormBase.php \Drupal\Core\Form\FormBase::config()

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.

19 calls to FormBase::config()
AddFormBase::isAdvancedUi in core/modules/media_library/src/Form/AddFormBase.php
Determines if the "advanced UI" of the Media Library is enabled.
BlockContentForm::save in core/modules/block_content/src/BlockContentForm.php
Form submission handler for the 'save' action.
BlockForm::form in core/modules/block/src/BlockForm.php
Gets the actual form array to be built.
CommentForm::form in core/modules/comment/src/CommentForm.php
Gets the actual form array to be built.
ConfigSingleImportForm::validateForm in core/modules/config/src/Form/ConfigSingleImportForm.php
Form validation handler.

... See full list

File

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

Class

FormBase
Provides a base class for forms.

Namespace

Drupal\Core\Form

Code

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