You are here

public function PdfLinksConfigurationForm::submitForm in Printer and PDF versions for Drupal 8+ 2.x

Same name and namespace in other branches
  1. 8 src/Form/PdfLinksConfigurationForm.php \Drupal\printable\Form\PdfLinksConfigurationForm::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 FormInterface::submitForm

File

src/Form/PdfLinksConfigurationForm.php, line 106

Class

PdfLinksConfigurationForm
Provides shared configuration form for all printable formats.

Namespace

Drupal\printable\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $this->configFactory
    ->getEditable('printable.settings')
    ->set('printable_pdf_link_locations', $form_state
    ->getValue('print_pdf_link_pos'))
    ->save();
  $this
    ->messenger()
    ->addStatus($this
    ->t('The configuration option has been saved'));
}