// Check if the form was already created
if ($cache =
$this->exposedFormCache->
getForm($view->storage->
id(),
$view->current_display
)) { return $cache;
} $form['#info'
] =
[];
// Go through each handler and let it generate its exposed widget.
foreach ($view->display_handler->handlers
as $type =>
$value) { /** @var \Drupal\views\Plugin\views\ViewsHandlerInterface $handler */
foreach ($view->
$type as $id =>
$handler) { if ($handler->
canExpose() &&
$handler->
isExposed()) { // Grouped exposed filters have their own forms.
// Instead of render the standard exposed form, a new Select or
// Radio form field is rendered with the available groups.
// When a user chooses an option the selected value is split
// into the operator and value that the item represents.
if ($handler->
isAGroup()) { $handler->
groupForm($form,
$form_state);
$id =
$handler->options
['group_info'
]['identifier'
];
} else { $handler->
buildExposedForm($form,
$form_state);
}