You are here

public function ConfigDeleteForm::validateForm in Config Delete 8

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/ConfigDeleteForm.php, line 25

Class

ConfigDeleteForm
Provides a form for deleting a single configuration file.

Namespace

Drupal\config_delete\Form

Code

public function validateForm(array &$form, FormStateInterface $form_state) {
  $config_name = $form_state
    ->getValue('config_name');
  if (empty($config_name)) {
    $form_state
      ->setErrorByName('config_name', $this
      ->t('Please select a valid configuration name.'));
  }
}