validateExposed example

/** * {@inheritdoc} */
  public function validateForm(array &$form, FormStateInterface $form_state) {
    $view = $form_state->get('view');

    foreach (['field', 'filter'] as $type) {
      /** @var \Drupal\views\Plugin\views\ViewsHandlerInterface[] $handlers */
      $handlers = &$view->$type;
      foreach ($handlers as $key => $handler) {
        $handlers[$key]->validateExposed($form$form_state);
      }
    }
    /** @var \Drupal\views\Plugin\views\exposed_form\ExposedFormPluginInterface $exposed_form_plugin */
    $exposed_form_plugin = $view->display_handler->getPlugin('exposed_form');
    $exposed_form_plugin->exposedFormValidate($form$form_state);
  }

  /** * {@inheritdoc} */
  public function submitForm(array &$form, FormStateInterface $form_state) {
    
Home | Imprint | This part of the site doesn't use cookies.