You are here

public function BookBreadcrumbBuilder::applies in Drupal 10

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

File

core/modules/book/src/BookBreadcrumbBuilder.php, line 73

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);
}