You are here

public static function BetterExposedFilters::ajaxCallback in Better Exposed Filters 8.4

Same name and namespace in other branches
  1. 8.5 src/Plugin/views/exposed_form/BetterExposedFilters.php \Drupal\better_exposed_filters\Plugin\views\exposed_form\BetterExposedFilters::ajaxCallback()

The form ajax callback.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Return value

array The form element to return.

File

src/Plugin/views/exposed_form/BetterExposedFilters.php, line 552

Class

BetterExposedFilters
Exposed form plugin that provides a basic exposed form.

Namespace

Drupal\better_exposed_filters\Plugin\views\exposed_form

Code

public static function ajaxCallback(array $form, FormStateInterface $form_state) {
  $triggering_element = $form_state
    ->getTriggeringElement();
  return NestedArray::getValue($form, array_slice($triggering_element['#array_parents'], 0, -1));
}