You are here

protected function TawkToExtraSettingsForm::submitUserInfo in Tawk.to - Live chat application (Drupal 8) 8

Same name and namespace in other branches
  1. 8.2 src/Form/TawkToExtraSettingsForm.php \Drupal\tawk_to\Form\TawkToExtraSettingsForm::submitUserInfo()

Helper function to independently submit the visibility UI.

Parameters

array $form: A nested array form elements comprising the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

1 call to TawkToExtraSettingsForm::submitUserInfo()
TawkToExtraSettingsForm::submitForm in src/Form/TawkToExtraSettingsForm.php
Form submission handler.

File

src/Form/TawkToExtraSettingsForm.php, line 273

Class

TawkToExtraSettingsForm
Provides form for block instance forms.

Namespace

Drupal\tawk_to\Form

Code

protected function submitUserInfo(array $form, FormStateInterface $form_state) {
  $visibility = [];
  foreach ($form_state
    ->getValue('user')['user'] as $key => $value) {
    $this
      ->config('tawk_to.settings')
      ->set($key, $value)
      ->save();
  }
}