You are here

public function CatalogBreadcrumbBuilder::applies in Ubercart 8.4

Whether this breadcrumb builder should be used to build the breadcrumb.

Parameters

\Drupal\Core\Routing\RouteMatchInterface $route_match: The current route match.

Return value

bool TRUE if this builder should be used or FALSE to let other builders decide.

Overrides BreadcrumbBuilderInterface::applies

File

uc_catalog/src/CatalogBreadcrumbBuilder.php, line 38

Class

CatalogBreadcrumbBuilder
Provides a custom breadcrumb builder for catalog node and listing pages.

Namespace

Drupal\uc_catalog

Code

public function applies(RouteMatchInterface $route_match) {
  $route_name = $route_match
    ->getRouteName();
  return $route_name == 'entity.node.canonical' && $route_match
    ->getParameter('node') && !empty($route_match
    ->getParameter('node')->taxonomy_catalog->target_id) || substr($route_name, 0, 16) == 'view.uc_catalog.' && $route_match
    ->getParameter('arg_0');
}