public function SettingsFormBase::submitForm in Mass Contact 8
Form submission handler.
Parameters
array $form: An associative array containing the structure of the form.
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
Overrides ConfigFormBase::submitForm
File
- src/
Form/ SettingsFormBase.php, line 31
Class
- SettingsFormBase
- Settings form base class.
Namespace
Drupal\mass_contact\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
parent::submitForm($form, $form_state);
$config = $this->configFactory
->getEditable('mass_contact.settings');
foreach ($this
->getConfigKeys() as $key) {
$config
->set($key, $form_state
->getValue($key));
}
$config
->save();
}