function DisplayPluginBase::getLinkDisplay

Same name in other branches
  1. 9 core/modules/views/src/Plugin/views/display/DisplayPluginBase.php \Drupal\views\Plugin\views\display\DisplayPluginBase::getLinkDisplay()
  2. 8.9.x core/modules/views/src/Plugin/views/display/DisplayPluginBase.php \Drupal\views\Plugin\views\display\DisplayPluginBase::getLinkDisplay()
  3. 10 core/modules/views/src/Plugin/views/display/DisplayPluginBase.php \Drupal\views\Plugin\views\display\DisplayPluginBase::getLinkDisplay()

Overrides DisplayPluginInterface::getLinkDisplay

3 calls to DisplayPluginBase::getLinkDisplay()
DisplayPluginBase::getPath in core/modules/views/src/Plugin/views/display/DisplayPluginBase.php
Returns the base path to use for this display.
DisplayPluginBase::getRoutedDisplay in core/modules/views/src/Plugin/views/display/DisplayPluginBase.php
Points to the display which can be linked by this display.
DisplayPluginBase::optionsSummary in core/modules/views/src/Plugin/views/display/DisplayPluginBase.php
Provides the default summary for options in the views UI.

File

core/modules/views/src/Plugin/views/display/DisplayPluginBase.php, line 717

Class

DisplayPluginBase
Base class for views display plugins.

Namespace

Drupal\views\Plugin\views\display

Code

public function getLinkDisplay() {
    $display_id = $this->getOption('link_display');
    // If unknown, pick the first one.
    if (empty($display_id) || !$this->view->displayHandlers
        ->has($display_id)) {
        foreach ($this->view->displayHandlers as $display_id => $display) {
            if (!empty($display) && $display->hasPath()) {
                return $display_id;
            }
        }
    }
    else {
        return $display_id;
    }
    // Fall-through returns NULL.
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.