You are here

public function Display::validateForm in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/views_ui/src/Form/Ajax/Display.php \Drupal\views_ui\Form\Ajax\Display::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 ViewsFormBase::validateForm

File

core/modules/views_ui/src/Form/Ajax/Display.php, line 98
Contains \Drupal\views_ui\Form\Ajax\Display.

Class

Display
Provides a form for editing the Views display.

Namespace

Drupal\views_ui\Form\Ajax

Code

public function validateForm(array &$form, FormStateInterface $form_state) {
  $view = $form_state
    ->get('view');
  $display_id = $form_state
    ->get('display_id');
  $view
    ->getExecutable()->displayHandlers
    ->get($display_id)
    ->validateOptionsForm($form['options'], $form_state);
  if ($form_state
    ->getErrors()) {
    $form_state
      ->set('rerender', TRUE);
  }
}