You are here

public function Lightbox2IframeSettingsForm::validateForm in Lightbox2 8

Same name in this branch
  1. 8 src/Lightbox2IframeSettingsForm.php \Drupal\lightbox2\Lightbox2IframeSettingsForm::validateForm()
  2. 8 src/Form/Lightbox2IframeSettingsForm.php \Drupal\lightbox2\Form\Lightbox2IframeSettingsForm::validateForm()

File

src/Lightbox2IframeSettingsForm.php, line 79

Class

Lightbox2IframeSettingsForm

Namespace

Drupal\lightbox2

Code

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