Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. TermRouteContext.php

function 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\ContextProvider

Code

public function getAvailableContexts() {
    $context = EntityContext::fromEntityTypeId('taxonomy_term', $this->t('Term from URL'));
    return [
        'taxonomy_term' => $context,
    ];
}
RSS feed
Powered by Drupal