You are here

public function SettingsForm::submitForm in Administer Users by Role 8.3

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/SettingsForm.php, line 89

Class

SettingsForm
Configure AlbanyWeb settings for this site.

Namespace

Drupal\administerusersbyrole\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $config = $this
    ->config('administerusersbyrole.settings');
  $values = $form_state
    ->cleanValues()
    ->getValues();
  foreach ($values as $rid => $value) {
    $config
      ->set("roles.{$rid}", $value);
  }
  $config
    ->save();
  parent::submitForm($form, $form_state);
}