You are here

public function PdfPreviewSettingsForm::submitForm in PDFPreview 2.0.x

Same name and namespace in other branches
  1. 8 src/PDFPreviewSettingsForm.php \Drupal\pdfpreview\PDFPreviewSettingsForm::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/PdfPreviewSettingsForm.php, line 93

Class

PdfPreviewSettingsForm
Configure PDF preview settings for this site.

Namespace

Drupal\pdfpreview

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $this
    ->config('pdfpreview.settings')
    ->set('path', $form_state
    ->getValue('path'))
    ->set('size', $form_state
    ->getValue('size'))
    ->set('quality', $form_state
    ->getValue('quality'))
    ->set('filenames', $form_state
    ->getValue('filenames'))
    ->set('type', $form_state
    ->getValue('type'))
    ->save();
  parent::submitForm($form, $form_state);
}