public function RngSettingsForm::submitForm in RNG - Events and Registrations 3.x
Same name and namespace in other branches
- 8.2 src/Form/RngSettingsForm.php \Drupal\rng\Form\RngSettingsForm::submitForm()
- 8 src/Form/RngSettingsForm.php \Drupal\rng\Form\RngSettingsForm::submitForm()
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/ RngSettingsForm.php, line 123
Class
- RngSettingsForm
- Configure primary RNG settings.
Namespace
Drupal\rng\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
$identity_types = [];
foreach ($form_state
->getValue('contactables') as $entity_type => $enabled) {
if ($enabled) {
$identity_types[] = $entity_type;
}
}
$config = $this
->config('rng.settings');
$config
->set('identity_types', $identity_types);
$config
->save();
$this
->messenger()
->addMessage(t('RNG settings updated.'));
}