You are here

public function ModuleSettingsForm::submitForm in Layout Builder Styles 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 FormInterface::submitForm

File

src/Form/ModuleSettingsForm.php, line 87

Class

ModuleSettingsForm
Class ModuleSettingsForm.

Namespace

Drupal\layout_builder_styles\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $multiselect = $form_state
    ->getValue('multiselect');
  $form_type = $form_state
    ->getValue('form_type');
  $config = $this
    ->configFactory()
    ->getEditable('layout_builder_styles.settings');
  $config
    ->set('multiselect', $multiselect);
  $config
    ->set('form_type', $form_type);
  $config
    ->save();
}