You are here

public function YoutubechannelSettingsForm::submitForm in YoutubeChannel 8.3

Same name and namespace in other branches
  1. 8 src/YoutubechannelSettingsForm.php \Drupal\youtubechannel\youtubechannelSettingsForm::submitForm()
  2. 8.2 src/YoutubechannelSettingsForm.php \Drupal\youtubechannel\YoutubechannelSettingsForm::submitForm()

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/YoutubechannelSettingsForm.php, line 125

Class

YoutubechannelSettingsForm
Provides Configure settings.

Namespace

Drupal\youtubechannel

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $this
    ->config('youtubechannel.settings')
    ->set('youtubechannel_api_key', $form_state
    ->getValue('youtubechannel_api_key'))
    ->set('youtubechannel_id', $form_state
    ->getValue('youtubechannel_id'))
    ->set('youtubechannel_video_limit', $form_state
    ->getValue('youtubechannel_video_limit'))
    ->set('youtubechannel_video_width', $form_state
    ->getValue('youtubechannel_video_width'))
    ->set('youtubechannel_video_height', $form_state
    ->getValue('youtubechannel_video_height'))
    ->save();
  parent::submitForm($form, $form_state);
}