You are here

protected function CanonicalEntity::appliesTo in Core Context 8

Determines if this provider can extract contexts from the current route.

Parameters

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

Return value

bool TRUE if this provider can extract contexts from the route, otherwise FALSE.

Overrides RouteAwareContextProviderBase::appliesTo

File

src/ContextProvider/CanonicalEntity.php, line 60

Class

CanonicalEntity
Exposes contexts available at a canonical entity route.

Namespace

Drupal\core_context\ContextProvider

Code

protected function appliesTo(Route $route) : bool {
  return strpos($this
    ->getEntityTypeAndViewModeFromRoute($route), '.') > 0;
}