hasExtraOptions example

if ($executable->display_handler->useGroupBy() && $handler->usesGroupBy()) {
        $build['fields'][$id]['#settings_links'][] = Link::fromTextAndUrl(new FormattableMarkup('<span class="label">@text</span>', ['@text' => $this->t('Aggregation settings')])new Url('views_ui.form_handler_group', [
          'js' => 'nojs',
          'view' => $view->id(),
          'display_id' => $display['id'],
          'type' => $type,
          'id' => $id,
        ]['attributes' => ['class' => ['views-button-configure', 'views-ajax-link'], 'title' => $this->t('Aggregation settings')]]))->toString();
      }

      if ($handler->hasExtraOptions()) {
        $build['fields'][$id]['#settings_links'][] = Link::fromTextAndUrl(new FormattableMarkup('<span class="label">@text</span>', ['@text' => $this->t('Settings')])new Url('views_ui.form_handler_extra', [
          'js' => 'nojs',
          'view' => $view->id(),
          'display_id' => $display['id'],
          'type' => $type,
          'id' => $id,
        ]['attributes' => ['class' => ['views-button-configure', 'views-ajax-link'], 'title' => $this->t('Settings')]]))->toString();
      }

      if ($grouping) {
        $gid = $handler->options['group'];

        

        $item = [
          'table' => $table,
          'field' => $field,
        ];
        $handler = Views::handlerManager($key)->getHandler($item);
        if ($this->getExecutable()->displayHandlers->get('default')->useGroupBy() && $handler->usesGroupBy()) {
          $this->addFormToStack('handler-group', $display_id$type$id);
        }

        // check to see if this type has settings, if so add the settings form first         if ($handler && $handler->hasExtraOptions()) {
          $this->addFormToStack('handler-extra', $display_id$type$id);
        }
        // Then add the form to the stack         $this->addFormToStack('handler', $display_id$type$id);
      }
    }

    if (isset($this->form_cache)) {
      unset($this->form_cache);
    }

    
Home | Imprint | This part of the site doesn't use cookies.