exposedInfo example


  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'];
      }
    }
  }

  /** * Build the form to let users create the group of exposed filters. * * This form is displayed when users click on button 'Build group'. */
          // 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);
          }
          if ($info = $handler->exposedInfo()) {
            $form['#info']["$type-$id"] = $info;
          }
        }
      }
    }

    $form['actions'] = [
      '#type' => 'actions',
    ];
    $form['actions']['submit'] = [
      // Prevent from showing up in \Drupal::request()->query.
Home | Imprint | This part of the site doesn't use cookies.