You are here

public function ReplicateUISettingsForm::submitForm in Replicate UI 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/ReplicateUISettingsForm.php, line 95

Class

ReplicateUISettingsForm

Namespace

Drupal\replicate_ui\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  parent::submitForm($form, $form_state);
  $this
    ->config('replicate_ui.settings')
    ->set('entity_types', array_values(array_filter($form_state
    ->getValue('entity_types'))))
    ->save();

  // @todo This should be done through a config save subscriber and it should
  // also invalidate the render/local tasks cache.
  $this->routerBuilder
    ->setRebuildNeeded();
  Cache::invalidateTags([
    'entity_types',
    'views_data',
  ]);
}