You are here

public function FacebookshareSettingsForm::submitForm in Facebook Share 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/FacebookshareSettingsForm.php, line 145
Contains \Drupal\facebookshare\Form\FacebookshareSettingsForm.

Class

FacebookshareSettingsForm
Administration settings form.

Namespace

Drupal\facebookshare\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $config = $this
    ->config('facebookshare.settings');
  foreach (Element::children($form) as $variable) {
    $config
      ->set($variable, $form_state
      ->getValue($form[$variable]['#parents']));
  }
  $config
    ->save();
  parent::submitForm($form, $form_state);
}