BreadcrumbManager
class BreadcrumbManager implements ChainBreadcrumbBuilderInterface (View source)
Provides a breadcrumb manager.
Can be assigned any number of BreadcrumbBuilderInterface objects by calling the addBuilder() method. When build() is called it iterates over the objects in priority order and uses the first one that returns TRUE from BreadcrumbBuilderInterface::applies() to build the breadcrumbs.
Properties
| protected ModuleHandlerInterface | $moduleHandler | The module handler to invoke the alter hook. |
|
| protected array | $builders | Holds arrays of breadcrumb builders, keyed by priority. |
|
| protected BreadcrumbBuilderInterface[]|null | $sortedBuilders | Holds the array of breadcrumb builders sorted by priority. |
Methods
Constructs a \Drupal\Core\Breadcrumb\BreadcrumbManager object.
Whether this breadcrumb builder should be used to build the breadcrumb.
Returns the sorted array of breadcrumb builders.
Details
__construct(ModuleHandlerInterface $module_handler)
Constructs a \Drupal\Core\Breadcrumb\BreadcrumbManager object.
addBuilder(BreadcrumbBuilderInterface $builder, int $priority)
Adds another breadcrumb builder.
bool
applies(RouteMatchInterface $route_match)
Whether this breadcrumb builder should be used to build the breadcrumb.
Breadcrumb
build(RouteMatchInterface $route_match)
Builds the breadcrumb.
protected BreadcrumbBuilderInterface[]
getSortedBuilders()
Returns the sorted array of breadcrumb builders.