You are here

public function ViewsAutorefreshArea::validateOptionsForm in Views Autorefresh D8 port 8

Validate the options form.

Overrides PluginBase::validateOptionsForm

File

src/Plugin/views/area/ViewsAutorefreshArea.php, line 61

Class

ViewsAutorefreshArea
Defines an area plugin for the Autorefresh header.

Namespace

Drupal\views_autorefresh_d8\Plugin\views\area

Code

public function validateOptionsForm(&$form, FormStateInterface $form_state) {
  if (!is_numeric($form_state
    ->getValue('options')['interval'])) {
    $form_state
      ->setError($form['interval'], $this
      ->t('The interval has to be a numeric value.'));
  }
}