You are here

public function Fz152ContactSettings::submitForm in FZ152 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

modules/contact/src/Form/Fz152ContactSettings.php, line 94

Class

Fz152ContactSettings
Configure example settings for this site.

Namespace

Drupal\fz152_contact\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $forms = $this
    ->getContactBundles();
  foreach (array_keys($forms) as $form_name) {
    $this
      ->config("fz152_contact.settings.{$form_name}")
      ->set('enabled', $form_state
      ->getValue('contact_' . $form_name . '_enable'))
      ->set('weight', $form_state
      ->getValue('contact_' . $form_name . '_weight'))
      ->set('langcode', 'ru')
      ->save();
  }
  parent::submitForm($form, $form_state);
}