You are here

public function ShareMessageSettingsForm::submitForm in Share Message 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/ShareMessageSettingsForm.php, line 80

Class

ShareMessageSettingsForm
Defines a form that configures Share Message global settings.

Namespace

Drupal\sharemessage\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  parent::submitForm($form, $form_state);
  $this
    ->config('sharemessage.settings')
    ->set('message_enforcement', $form_state
    ->getValue('message_enforcement'))
    ->set('add_twitter_card', $form_state
    ->getValue('add_twitter_card'))
    ->set('twitter_user', $form_state
    ->getValue('twitter_user'))
    ->save();
}