function PathPluginBase::overrideApplies

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

Determines whether the view overrides the given route.

Parameters

string $view_path: The path of the view.

\Symfony\Component\Routing\Route $view_route: The route of the view.

\Symfony\Component\Routing\Route $route: The route itself.

Return value

bool TRUE, when the view should override the given route.

1 call to PathPluginBase::overrideApplies()
PathPluginBase::alterRoutes in core/modules/views/src/Plugin/views/display/PathPluginBase.php
Alters a collection of routes and replaces definitions to the view.
1 method overrides PathPluginBase::overrideApplies()
RestExport::overrideApplies in core/modules/rest/src/Plugin/views/display/RestExport.php
Determines whether the view overrides the given route.

File

core/modules/views/src/Plugin/views/display/PathPluginBase.php, line 248

Class

PathPluginBase
The base display plugin for path/callbacks. This is used for pages and feeds.

Namespace

Drupal\views\Plugin\views\display

Code

protected function overrideApplies($view_path, Route $view_route, Route $route) {
    return (!$route->hasRequirement('_format') || $route->getRequirement('_format') === 'html') && $this->overrideAppliesPathAndMethod($view_path, $view_route, $route);
}

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