You are here

public function SettingsForm::submitForm in Video Embed Brightcove 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/SettingsForm.php, line 135

Class

SettingsForm
Configure Video Embed Brightcove module.

Namespace

Drupal\video_embed_brightcove\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  parent::submitForm($form, $form_state);
  $config = $this
    ->config('video_embed_brightcove.settings');
  $config
    ->set('client_id', trim($form_state
    ->getValue('client_id')));
  $config
    ->set('client_secret', trim($form_state
    ->getValue('client_secret')));
  $config
    ->set('autoplay_player', trim($form_state
    ->getValue('autoplay_player')));
  $config
    ->save();
}