You are here

public function HelpBreadcrumbBuilder::build in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/help_topics/src/HelpBreadcrumbBuilder.php \Drupal\help_topics\HelpBreadcrumbBuilder::build()
  2. 10 core/modules/help_topics/src/HelpBreadcrumbBuilder.php \Drupal\help_topics\HelpBreadcrumbBuilder::build()

Builds the breadcrumb.

Parameters

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

Return value

\Drupal\Core\Breadcrumb\Breadcrumb A breadcrumb.

Overrides BreadcrumbBuilderInterface::build

File

core/modules/help_topics/src/HelpBreadcrumbBuilder.php, line 44

Class

HelpBreadcrumbBuilder
Provides a breadcrumb builder for help topic pages.

Namespace

Drupal\help_topics

Code

public function build(RouteMatchInterface $route_match) {
  $breadcrumb = new Breadcrumb();
  $breadcrumb
    ->addCacheContexts([
    'url.path.parent',
  ]);
  $breadcrumb
    ->addLink(Link::createFromRoute($this
    ->t('Home'), '<front>'));
  $breadcrumb
    ->addLink(Link::createFromRoute($this
    ->t('Administration'), 'system.admin'));
  $breadcrumb
    ->addLink(Link::createFromRoute($this
    ->t('Help'), 'help.main'));
  return $breadcrumb;
}