Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. WizardPluginBase.php

function WizardPluginBase::buildDisplayOptions

Builds an array of display options for the view.

Return value

array An array whose keys are the names of each display and whose values are arrays of options for that display.

3 calls to WizardPluginBase::buildDisplayOptions()
NodeRevision::buildDisplayOptions in core/modules/node/src/Plugin/views/wizard/NodeRevision.php
Builds an array of display options for the view.
NodeRevision::buildDisplayOptions in core/modules/node/src/Plugin/views/wizard/NodeRevision.php
Builds an array of display options for the view.
WizardPluginBase::instantiateView in core/modules/views/src/Plugin/views/wizard/WizardPluginBase.php
Instantiates a view object from form values.
1 method overrides WizardPluginBase::buildDisplayOptions()
NodeRevision::buildDisplayOptions in core/modules/node/src/Plugin/views/wizard/NodeRevision.php
Builds an array of display options for the view.

File

core/modules/views/src/Plugin/views/wizard/WizardPluginBase.php, line 719

Class

WizardPluginBase
Base class for Views wizard plugins.

Namespace

Drupal\views\Plugin\views\wizard

Code

protected function buildDisplayOptions($form, FormStateInterface $form_state) {
    // Display: Default
    $display_options['default'] = $this->defaultDisplayOptions();
    $display_options['default'] += [
        'filters' => [],
        'sorts' => [],
    ];
    $display_options['default']['filters'] += $this->defaultDisplayFilters($form, $form_state);
    $display_options['default']['sorts'] += $this->defaultDisplaySorts($form, $form_state);
    // Display: Page
    if (!$form_state->isValueEmpty([
        'page',
        'create',
    ])) {
        $display_options['page'] = $this->pageDisplayOptions($form, $form_state);
        // Display: Feed (attached to the page)
        if (!$form_state->isValueEmpty([
            'page',
            'feed',
        ])) {
            $display_options['feed'] = $this->pageFeedDisplayOptions($form, $form_state);
        }
    }
    // Display: Block
    if (!$form_state->isValueEmpty([
        'block',
        'create',
    ])) {
        $display_options['block'] = $this->blockDisplayOptions($form, $form_state);
    }
    // Display: REST export.
    if (!$form_state->isValueEmpty([
        'rest_export',
        'create',
    ])) {
        $display_options['rest_export'] = $this->restExportDisplayOptions($form, $form_state);
    }
    return $display_options;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal