You are here

abstract protected function RouteAwareContextProviderBase::getContextsFromRoute in Core Context 8

Extracts contexts from the current route.

Parameters

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

Return value

\Drupal\Component\Plugin\Context\ContextInterface[] The contexts extracted from the route, keyed by name. Any contexts which can accept cache metadata will get the 'route' cache context applied.

1 call to RouteAwareContextProviderBase::getContextsFromRoute()
RouteAwareContextProviderBase::getRuntimeContexts in src/ContextProvider/RouteAwareContextProviderBase.php
Gets runtime context values for the given context IDs.
2 methods override RouteAwareContextProviderBase::getContextsFromRoute()
CanonicalEntity::getContextsFromRoute in src/ContextProvider/CanonicalEntity.php
Extracts contexts from the current route.
LayoutBuilder::getContextsFromRoute in src/ContextProvider/LayoutBuilder.php
Extracts contexts from the current route.

File

src/ContextProvider/RouteAwareContextProviderBase.php, line 59

Class

RouteAwareContextProviderBase
Provides a base class for context providers which use the current route.

Namespace

Drupal\core_context\ContextProvider

Code

protected abstract function getContextsFromRoute(Route $route) : array;