You are here

public function ConfigRevertConfirmForm::submitForm in Configuration Update Manager 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 FormInterface::submitForm

File

config_update_ui/src/Form/ConfigRevertConfirmForm.php, line 139

Class

ConfigRevertConfirmForm
Defines a confirmation form for reverting configuration.

Namespace

Drupal\config_update_ui\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $this->configRevert
    ->revert($this->type, $this->name);
  $this
    ->messenger()
    ->addMessage($this
    ->t('The configuration %item has been reverted to its source.', [
    '%item' => $this->name,
  ]));
  $form_state
    ->setRedirectUrl($this
    ->getCancelUrl());
}