public function RegistrationRoleSettings::submitForm in Registration role 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/ RegistrationRoleSettings.php, line 78
Class
- RegistrationRoleSettings
- Contribute form.
Namespace
Drupal\registration_role\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
$saved_role = array_filter($form_state
->getValue('role_to_select'));
$this
->config('registration_role.setting')
->set('role_to_select', $saved_role)
->save();
$saved_mode = $form_state
->getValue('registration_mode');
$this
->config('registration_role.setting')
->set('registration_mode', $saved_mode)
->save();
parent::submitForm($form, $form_state);
}