You are here

public function TableSorterSettings::submitForm in Tablesorter 8

Same name and namespace in other branches
  1. 3.0.x src/Form/TableSorterSettings.php \Drupal\tablesorter\Form\TableSorterSettings::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/Form/TableSorterSettings.php, line 76

Class

TableSorterSettings
Table sorter settings form.

Namespace

Drupal\tablesorter\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $userInputValues = $form_state
    ->getUserInput();
  $config = $this->configFactory
    ->getEditable('tablesorter.settings')
    ->set('tablesorter_theme', $userInputValues['tablesorter_theme'])
    ->set('tablesorter_zebra', $userInputValues['tablesorter_zebra'])
    ->set('tablesorter_zebra_odd_class', $userInputValues['tablesorter_zebra_odd_class'])
    ->set('tablesorter_zebra_even_class', $userInputValues['tablesorter_zebra_even_class'])
    ->save();
  parent::submitForm($form, $form_state);
}