function TermBreadcrumbBuilder::applies

Same name in other branches
  1. 9 core/modules/taxonomy/src/TermBreadcrumbBuilder.php \Drupal\taxonomy\TermBreadcrumbBuilder::applies()
  2. 8.9.x core/modules/taxonomy/src/TermBreadcrumbBuilder.php \Drupal\taxonomy\TermBreadcrumbBuilder::applies()
  3. 11.x core/modules/taxonomy/src/TermBreadcrumbBuilder.php \Drupal\taxonomy\TermBreadcrumbBuilder::applies()

Overrides BreadcrumbBuilderInterface::applies

File

core/modules/taxonomy/src/TermBreadcrumbBuilder.php, line 49

Class

TermBreadcrumbBuilder
Provides a custom taxonomy breadcrumb builder that uses the term hierarchy.

Namespace

Drupal\taxonomy

Code

public function applies(RouteMatchInterface $route_match) {
    return $route_match->getRouteName() == 'entity.taxonomy_term.canonical' && $route_match->getParameter('taxonomy_term') instanceof TermInterface;
}

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