You are here

public function DisplayPluginBase::getLinkDisplay in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/views/src/Plugin/views/display/DisplayPluginBase.php \Drupal\views\Plugin\views\display\DisplayPluginBase::getLinkDisplay()

Returns the ID of the display to use when making links.

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 708
Contains \Drupal\views\Plugin\views\display\DisplayPluginBase.

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.
}