function DevelReinstall::validateForm

Same name and namespace in other branches
  1. 5.x src/Form/DevelReinstall.php \Drupal\devel\Form\DevelReinstall::validateForm()

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\Form

Code

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.'));
    }
}