You are here

public function BookBreadcrumbBuilder::applies in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/book/src/BookBreadcrumbBuilder.php \Drupal\book\BookBreadcrumbBuilder::applies()

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

core/modules/book/src/BookBreadcrumbBuilder.php, line 66
Contains \Drupal\book\BookBreadcrumbBuilder.

Class

BookBreadcrumbBuilder
Provides a breadcrumb builder for nodes in a book.

Namespace

Drupal\book

Code

public function applies(RouteMatchInterface $route_match) {
  $node = $route_match
    ->getParameter('node');
  return $node instanceof NodeInterface && !empty($node->book);
}