public function RoleAssignAdminForm::submitForm in RoleAssign 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/ RoleAssignAdminForm.php, line 55
Class
- RoleAssignAdminForm
- Configure book settings for this site.
Namespace
Drupal\roleassign\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
// Clean up roleassign_roles values before saving to config.
$roleassign_roles = $form_state
->getValue('roleassign_roles');
$roleassign_roles = array_keys(array_filter($roleassign_roles));
sort($roleassign_roles);
$this
->config('roleassign.settings')
->set('roleassign_roles', $roleassign_roles)
->save();
parent::submitForm($form, $form_state);
}