You are here

protected function FilterPluginBase::buildValueWrapper in Drupal 10

Same name and namespace in other branches
  1. 9 core/modules/views/src/Plugin/views/filter/FilterPluginBase.php \Drupal\views\Plugin\views\filter\FilterPluginBase::buildValueWrapper()

Builds wrapper for value and operator forms.

Parameters

array $form: The form.

string $wrapper_identifier: The key to use for the wrapper element.

1 call to FilterPluginBase::buildValueWrapper()
FilterPluginBase::buildExposedForm in core/modules/views/src/Plugin/views/filter/FilterPluginBase.php
Render our chunk of the exposed filter form when selecting.

File

core/modules/views/src/Plugin/views/filter/FilterPluginBase.php, line 972

Class

FilterPluginBase
Base class for Views filters handler plugins.

Namespace

Drupal\views\Plugin\views\filter

Code

protected function buildValueWrapper(&$form, $wrapper_identifier) {

  // If both the field and the operator are exposed, this will end up being
  // called twice. We don't want to wipe out what's already there, so if it
  // exists already, do nothing.
  if (!isset($form[$wrapper_identifier])) {
    $form[$wrapper_identifier] = [
      '#type' => 'fieldset',
    ];
    $exposed_info = $this
      ->exposedInfo();
    if (!empty($exposed_info['label'])) {
      $form[$wrapper_identifier]['#title'] = $exposed_info['label'];
    }
    if (!empty($exposed_info['description'])) {
      $form[$wrapper_identifier]['#description'] = $exposed_info['description'];
    }
  }
}