function InputRequired::exposedFilterApplied

Same name in other branches
  1. 9 core/modules/views/src/Plugin/views/exposed_form/InputRequired.php \Drupal\views\Plugin\views\exposed_form\InputRequired::exposedFilterApplied()
  2. 8.9.x core/modules/views/src/Plugin/views/exposed_form/InputRequired.php \Drupal\views\Plugin\views\exposed_form\InputRequired::exposedFilterApplied()
  3. 11.x core/modules/views/src/Plugin/views/exposed_form/InputRequired.php \Drupal\views\Plugin\views\exposed_form\InputRequired::exposedFilterApplied()
2 calls to InputRequired::exposedFilterApplied()
InputRequired::preRender in core/modules/views/src/Plugin/views/exposed_form/InputRequired.php
InputRequired::query in core/modules/views/src/Plugin/views/exposed_form/InputRequired.php

File

core/modules/views/src/Plugin/views/exposed_form/InputRequired.php, line 50

Class

InputRequired
Exposed form plugin that provides an exposed form with required input.

Namespace

Drupal\views\Plugin\views\exposed_form

Code

protected function exposedFilterApplied() {
    static $cache = NULL;
    if (!isset($cache)) {
        $view = $this->view;
        if (is_array($view->filter) && count($view->filter)) {
            foreach ($view->filter as $filter) {
                if ($filter->isExposed()) {
                    $identifier = $filter->options['expose']['identifier'];
                    if (isset($view->getExposedInput()[$identifier])) {
                        $cache = TRUE;
                        return $cache;
                    }
                }
            }
        }
        $cache = FALSE;
    }
    return $cache;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.