You are here

public function ViewsDisplayBase::isRenderedInCurrentRequest in Search API 8

Returns true if the display is being rendered in the current request.

Return value

bool True when the display is rendered in the current request.

Overrides DisplayPluginBase::isRenderedInCurrentRequest

1 method overrides ViewsDisplayBase::isRenderedInCurrentRequest()
ViewsBlock::isRenderedInCurrentRequest in src/Plugin/search_api/display/ViewsBlock.php
Returns true if the display is being rendered in the current request.

File

src/Plugin/search_api/display/ViewsDisplayBase.php, line 75

Class

ViewsDisplayBase
Provides a base class for Views displays.

Namespace

Drupal\search_api\Plugin\search_api\display

Code

public function isRenderedInCurrentRequest() {
  $plugin_definition = $this
    ->getPluginDefinition();
  $current_route = $this
    ->getCurrentRouteMatch();
  $view_id = $current_route
    ->getParameter('view_id');
  $display_id = $current_route
    ->getParameter('display_id');
  return $view_id === $plugin_definition['view_id'] && $display_id === $plugin_definition['view_display'];
}