You are here

public function SettingsForm::submitForm in Pager Serializer 8

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/SettingsForm.php, line 174

Class

SettingsForm
Configure example settings for this site.

Namespace

Drupal\pager_serializer\Form

Code

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

  // Retrieve the configuration.
  $this->configFactory
    ->getEditable(static::SETTINGS)
    ->set('rows_label', $form_state
    ->getValue('rows_label'))
    ->set('pager_label', $form_state
    ->getValue('pager_label'))
    ->set('pager_object_enabled', $form_state
    ->getValue('pager_object_enabled'))
    ->set('current_page_enabled', $form_state
    ->getValue('current_page_enabled'))
    ->set('current_page_label', $form_state
    ->getValue('current_page_label'))
    ->set('total_items_enabled', $form_state
    ->getValue('total_items_enabled'))
    ->set('total_items_label', $form_state
    ->getValue('total_items_label'))
    ->set('total_pages_enabled', $form_state
    ->getValue('total_pages_enabled'))
    ->set('total_pages_label', $form_state
    ->getValue('total_pages_label'))
    ->set('items_per_page_enabled', $form_state
    ->getValue('items_per_page_enabled'))
    ->set('items_per_page_label', $form_state
    ->getValue('items_per_page_label'))
    ->save();
  parent::submitForm($form, $form_state);
}