You are here

public function PagererConfigForm::submitForm in Pagerer 8

Same name and namespace in other branches
  1. 8.2 src/Form/PagererConfigForm.php \Drupal\pagerer\Form\PagererConfigForm::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/PagererConfigForm.php, line 124

Class

PagererConfigForm
Main Pagerer settings admin form.

Namespace

Drupal\pagerer\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {

  // Set pager override if it has changed.
  $pager_override = $form_state
    ->getValue('core_override_preset');
  if ($this
    ->config('pagerer.settings')
    ->get('core_override_preset') !== $pager_override) {
    $this
      ->config('pagerer.settings')
      ->set('core_override_preset', $pager_override)
      ->save();
    $this->elementInfoManager
      ->clearCachedDefinitions();
  }
  parent::submitForm($form, $form_state);
}