You are here

public function ShrinkTheWebLogForm::validateForm in ShrinkTheWeb 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/ShrinkTheWebLogForm.php, line 93

Class

ShrinkTheWebLogForm

Namespace

Drupal\shrinktheweb\Form

Code

public function validateForm(array &$form, FormStateInterface $form_state) {
  $log_recs = array_filter($form_state
    ->getValue('log_records'));
  if (!$log_recs) {
    $form_state
      ->setErrorByName('log_records', t('Please, select a log record'));
  }
}