You are here

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

Same name and namespace in other branches
  1. 8 src/Form/LinksConfigurationForm.php \Drupal\printable\Form\LinksConfigurationForm::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/LinksConfigurationForm.php, line 106

Class

LinksConfigurationForm
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_print_link_locations', $form_state
    ->getValue('print_print_link_pos'))
    ->save();
  $this
    ->messenger()
    ->addStatus($this
    ->t('The configuration option has been saved'));
}