function ThemeUninstallConfirmForm::submitForm
Same name and namespace in other branches
- main core/modules/system/src/Form/ThemeUninstallConfirmForm.php \Drupal\system\Form\ThemeUninstallConfirmForm::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 FormInterface::submitForm
File
-
core/
modules/ system/ src/ Form/ ThemeUninstallConfirmForm.php, line 142
Class
- ThemeUninstallConfirmForm
- Builds a confirmation form to uninstall a theme.
Namespace
Drupal\system\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) : void {
$themes = $this->themeHandler
->listInfo();
$theme = $form_state->getValue('theme');
$this->themeInstaller
->uninstall([
$form_state->getValue('theme'),
]);
$this->messenger()
->addStatus($this->t('The %theme theme has been uninstalled.', [
'%theme' => $themes[$theme]->info['name'],
]));
$form_state->setRedirectUrl($this->getCancelUrl());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.