function ModulesUninstallConfirmForm::submitForm
Same name in other branches
- 8.9.x core/modules/system/src/Form/ModulesUninstallConfirmForm.php \Drupal\system\Form\ModulesUninstallConfirmForm::submitForm()
- 10 core/modules/system/src/Form/ModulesUninstallConfirmForm.php \Drupal\system\Form\ModulesUninstallConfirmForm::submitForm()
- 11.x core/modules/system/src/Form/ModulesUninstallConfirmForm.php \Drupal\system\Form\ModulesUninstallConfirmForm::submitForm()
Overrides FormInterface::submitForm
File
-
core/
modules/ system/ src/ Form/ ModulesUninstallConfirmForm.php, line 168
Class
- ModulesUninstallConfirmForm
- Builds a confirmation form to uninstall selected modules.
Namespace
Drupal\system\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
// Clear the key value store entry.
$account = $this->currentUser()
->id();
$this->keyValueExpirable
->delete($account);
// Uninstall the modules.
$this->moduleInstaller
->uninstall($this->modules);
$this->messenger()
->addStatus($this->t('The selected modules have been uninstalled.'));
$form_state->setRedirectUrl($this->getCancelUrl());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.