ConfigFormBaseTrait

Provides access to configuration for forms.

This trait provides a config() method that returns override free and mutable config objects if the configuration name is in the array returned by the getEditableConfigNames() implementation.

Forms that present configuration to the user have to take care not to save configuration overrides to the stored configuration since overrides are often environment specific. Default values of form elements should be obtained from override free configuration objects. However, if a form reacts to configuration in any way, for example sends an email to the system.site:mail address, then it is important that the value comes from a configuration object with overrides. Therefore, override free and editable configuration objects are limited to those listed by the getEditableConfigNames() method.

Hierarchy

File

core/lib/Drupal/Core/Form/ConfigFormBaseTrait.php, line 23

Namespace

Drupal\Core\Form

Members

Name Modifiers Type Description
ConfigFormBaseTrait::config protected function Retrieves a configuration object.
ConfigFormBaseTrait::getEditableConfigNames abstract protected function Gets the configuration names that will be editable.
doc_Drupal
2016-10-29 08:53:25
Comments
Leave a Comment

Please login to continue.