public function DevelReinstall::validateForm in Devel 4.x
Same name and namespace in other branches
- 8.3 src/Form/DevelReinstall.php \Drupal\devel\Form\DevelReinstall::validateForm()
- 8 src/Form/DevelReinstall.php \Drupal\devel\Form\DevelReinstall::validateForm()
- 8.2 src/Form/DevelReinstall.php \Drupal\devel\Form\DevelReinstall::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
- src/
Form/ DevelReinstall.php, line 143
Class
- DevelReinstall
- Display a dropdown of installed modules with the option to reinstall them.
Namespace
Drupal\devel\FormCode
public function validateForm(array &$form, FormStateInterface $form_state) {
// Form submitted, but no modules selected.
if (!array_filter($form_state
->getValue('reinstall'))) {
$form_state
->setErrorByName('reinstall', $this
->t('No modules selected.'));
}
}