function TermRouteContext::getAvailableContexts
Same name in other branches
- 9 core/modules/taxonomy/src/ContextProvider/TermRouteContext.php \Drupal\taxonomy\ContextProvider\TermRouteContext::getAvailableContexts()
- 10 core/modules/taxonomy/src/ContextProvider/TermRouteContext.php \Drupal\taxonomy\ContextProvider\TermRouteContext::getAvailableContexts()
Overrides ContextProviderInterface::getAvailableContexts
File
-
core/
modules/ taxonomy/ src/ ContextProvider/ TermRouteContext.php, line 70
Class
- TermRouteContext
- Sets the current taxonomy term as a context on taxonomy term routes.
Namespace
Drupal\taxonomy\ContextProviderCode
public function getAvailableContexts() {
$context = EntityContext::fromEntityTypeId('taxonomy_term', $this->t('Term from URL'));
return [
'taxonomy_term' => $context,
];
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.