showExposeForm example


    else {
      // Add the subform from operatorForm().       $this->showOperatorForm($form$form_state);
      // Add the subform from valueForm().       $this->showValueForm($form$form_state);
      $form['clear_markup_end'] = [
        '#markup' => '</div>',
      ];
      if ($this->canExpose()) {
        // Add the subform from buildExposeForm().         $this->showExposeForm($form$form_state);
      }
    }
  }

  /** * Simple validate handler. */
  public function validateOptionsForm(&$form, FormStateInterface $form_state) {
    $this->operatorValidate($form$form_state);
    $this->valueValidate($form$form_state);
    if (!empty($this->options['exposed']) && !$this->isAGroup()) {
      

  public function buildOptionsForm(&$form, FormStateInterface $form_state) {
    parent::buildOptionsForm($form$form_state);
    if ($this->canExpose()) {
      $this->showExposeButton($form$form_state);
    }
    $form['op_val_start'] = ['#value' => '<div class="clearfix">'];
    $this->showSortForm($form$form_state);
    $form['op_val_end'] = ['#value' => '</div>'];
    if ($this->canExpose()) {
      $this->showExposeForm($form$form_state);
    }
  }

  /** * Shortcut to display the expose/hide button. */
  public function showExposeButton(&$form, FormStateInterface $form_state) {
    $form['expose_button'] = [
      '#prefix' => '<div class="views-expose clearfix">',
      '#suffix' => '</div>',
      // Should always come first
Home | Imprint | This part of the site doesn't use cookies.