You are here

public function YoutubeSettingsForm::submitForm in YouTube Field 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/YoutubeSettingsForm.php, line 130

Class

YoutubeSettingsForm
Configure Youtube settings for this site.

Namespace

Drupal\youtube\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $values = $form_state
    ->getValues();
  $this->configFactory
    ->getEditable('youtube.settings')
    ->set('youtube_suggest', $values['youtube_suggest'])
    ->set('youtube_modestbranding', $values['youtube_modestbranding'])
    ->set('youtube_theme', $values['youtube_theme'])
    ->set('youtube_color', $values['youtube_color'])
    ->set('youtube_enablejsapi', $values['youtube_enablejsapi'])
    ->set('youtube_privacy', $values['youtube_privacy'])
    ->set('youtube_wmode', $values['youtube_wmode'])
    ->set('youtube_override', $values['youtube_override'])
    ->set('youtube_player_class', $values['youtube_player_class'])
    ->set('youtube_thumb_dir', $values['youtube_thumb_dir'])
    ->set('youtube_thumb_hires', $values['youtube_thumb_hires'])
    ->set('youtube_thumb_token_image_style', $values['youtube_thumb_token_image_style'])
    ->save();
  parent::submitForm($form, $form_state);
}