You are here

public function FormatConfigurationFormPrint::submitForm in Printer and PDF versions for Drupal 8+ 8

Same name and namespace in other branches
  1. 2.x src/Form/FormatConfigurationFormPrint.php \Drupal\printable\Form\FormatConfigurationFormPrint::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/FormatConfigurationFormPrint.php, line 97

Class

FormatConfigurationFormPrint
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('send_to_printer', $form_state
    ->getValue('print_html_sendtoprinter'))
    ->set('close_window', $form_state
    ->getValue('print_html_windowclose'))
    ->set('list_attribute', $form_state
    ->getValue('print_html_display_sys_urllist'))
    ->save();
  drupal_set_message('The configuration option has been saved', 'status');
}