You are here

public function SelectRegistrationConfigForm::submitForm in Select registration roles 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/SelectRegistrationConfigForm.php, line 92
Contains \Drupal\select_registration_roles\Form\SelectRegistrationConfigForm.

Class

SelectRegistrationConfigForm

Namespace

Drupal\select_registration_roles\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {

  // Set & save the configuration : get the $config object.
  $config = $this
    ->config('select_registration_roles.settings');

  // Set simple value key / value.
  $config
    ->set('select_registration_roles_setby_admin', $form_state
    ->getValue('select_registration_roles_setby_admin'));
  $config
    ->set('select_registration_roles_admin_approval', $form_state
    ->getValue('select_registration_roles_admin_approval'));
  $config
    ->save();
  drupal_set_message($this
    ->t('The configuration options have been saved.'));
}