You are here

public function CoreViewsFacetSourceBase::isRenderedInCurrentRequest in Core Views Facets 8

Returns true if the Facet source is being rendered in the current request.

This function will define if all facets for this facet source are shown when facet source visibility: "being rendered" is configured in the facet visibility settings.

Return value

bool True when the facet is rendered on the same page.

Overrides FacetSourcePluginBase::isRenderedInCurrentRequest

3 calls to CoreViewsFacetSourceBase::isRenderedInCurrentRequest()
CoreViewsContextualFilter::isRenderedInCurrentRequest in src/Plugin/facets/facet_source/CoreViewsContextualFilter.php
Returns true if the Facet source is being rendered in the current request.
CoreViewsExposedFilter::isRenderedInCurrentRequest in src/Plugin/facets/facet_source/CoreViewsExposedFilter.php
Returns true if the Facet source is being rendered in the current request.
CoreViewsFacetSourceBase::getViewsArgumentsMap in src/Plugin/facets/facet_source/CoreViewsFacetSourceBase.php
Retrieves the current views arguments map and returns a detailed version.
2 methods override CoreViewsFacetSourceBase::isRenderedInCurrentRequest()
CoreViewsContextualFilter::isRenderedInCurrentRequest in src/Plugin/facets/facet_source/CoreViewsContextualFilter.php
Returns true if the Facet source is being rendered in the current request.
CoreViewsExposedFilter::isRenderedInCurrentRequest in src/Plugin/facets/facet_source/CoreViewsExposedFilter.php
Returns true if the Facet source is being rendered in the current request.

File

src/Plugin/facets/facet_source/CoreViewsFacetSourceBase.php, line 158

Class

CoreViewsFacetSourceBase
Provide common functions for core Views based facet sources.

Namespace

Drupal\core_views_facets\Plugin\facets\facet_source

Code

public function isRenderedInCurrentRequest() {
  if ($this->request->attributes
    ->get('_controller') === 'Drupal\\views\\Routing\\ViewPageController::handle') {
    list(, $view) = explode(':', $this
      ->getPluginId());
    list($view_id, $view_display) = explode('__', $view);
    if ($this->request->attributes
      ->get('view_id') == $view_id && $this->request->attributes
      ->get('display_id') == $view_display) {
      return TRUE;
    }
  }
  return FALSE;
}