You are here

public function Lightbox2SlideshowSettingsForm::validateForm in Lightbox2 8

Same name in this branch
  1. 8 src/Lightbox2SlideshowSettingsForm.php \Drupal\lightbox2\Lightbox2SlideshowSettingsForm::validateForm()
  2. 8 src/Form/Lightbox2SlideshowSettingsForm.php \Drupal\lightbox2\Form\Lightbox2SlideshowSettingsForm::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/Lightbox2SlideshowSettingsForm.php, line 120
Contains \Drupal\lightbox2\Form\Lightbox2SlideshowSettingsForm.

Class

Lightbox2SlideshowSettingsForm

Namespace

Drupal\lightbox2\Form

Code

public function validateForm(array &$form, \Drupal\Core\Form\FormStateInterface $form_state) {
  if (!is_numeric($form_state
    ->getValue([
    'lightbox2_slideshow_interval',
  ]))) {
    $form_state
      ->setErrorByName('lightbox2_slideshow_interval', t('The "interval seconds" value must be numeric.'));
  }
}