public function ModulesUninstallForm::validateForm in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/system/src/Form/ModulesUninstallForm.php \Drupal\system\Form\ModulesUninstallForm::validateForm()
Form validation 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 FormBase::validateForm
File
- core/
modules/ system/ src/ Form/ ModulesUninstallForm.php, line 172 - Contains \Drupal\system\Form\ModulesUninstallForm.
Class
- ModulesUninstallForm
- Provides a form for uninstalling modules.
Namespace
Drupal\system\FormCode
public function validateForm(array &$form, FormStateInterface $form_state) {
// Form submitted, but no modules selected.
if (!array_filter($form_state
->getValue('uninstall'))) {
$form_state
->setErrorByName('uninstall', $this
->t('No modules selected.'));
$form_state
->setRedirect('system.modules_uninstall');
}
}