You are here

public function BreadcrumbBuilder::applies in Custom Breadcrumbs 1.x

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

src/BreadcrumbBuilder.php, line 150

Class

BreadcrumbBuilder
Class BreadcrumbBuilder.

Namespace

Drupal\custom_breadcrumbs

Code

public function applies(RouteMatchInterface $route_match) {
  $route = $route_match
    ->getRouteObject();
  if (isset($this->customBreadcrumbsSettings['admin_pages_disable']) && $this->customBreadcrumbsSettings['admin_pages_disable'] == TRUE && (!empty($route) && $this->routerAdminContext
    ->isAdminRoute($route))) {
    return FALSE;
  }
  return TRUE;
}