Drupal 8  8.0.2
BreadcrumbManager Class Reference
Inheritance diagram for BreadcrumbManager:

Public Member Functions

 __construct (ModuleHandlerInterface $module_handler)
 
 addBuilder (BreadcrumbBuilderInterface $builder, $priority)
 
 applies (RouteMatchInterface $route_match)
 
 build (RouteMatchInterface $route_match)
 

Protected Member Functions

 getSortedBuilders ()
 

Protected Attributes

 $moduleHandler
 
 $builders = array()
 
 $sortedBuilders
 

Detailed Description

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.

See Also

Constructor & Destructor Documentation

__construct ( ModuleHandlerInterface  $module_handler)

Constructs a object.

Parameters
\Drupal\Core\Extension\ModuleHandlerInterface$module_handlerThe module handler.

References Drupal\moduleHandler().

Here is the call graph for this function:

Member Function Documentation

addBuilder ( BreadcrumbBuilderInterface  $builder,
  $priority 
)

{Adds another breadcrumb builder.

Parameters
\Drupal\Core\Breadcrumb\BreadcrumbBuilderInterface$builderThe breadcrumb builder to add.
int$priorityPriority of the breadcrumb builder.
}

Implements ChainBreadcrumbBuilderInterface.

applies ( RouteMatchInterface  $route_match)

{Whether this breadcrumb builder should be used to build the breadcrumb.

Parameters
\Drupal\Core\Routing\RouteMatchInterface$route_matchThe current route match.
Returns
bool TRUE if this builder should be used or FALSE to let other builders decide.
}

Implements BreadcrumbBuilderInterface.

build ( RouteMatchInterface  $route_match)

{Builds the breadcrumb.

Parameters
\Drupal\Core\Routing\RouteMatchInterface$route_matchThe current route match.
Returns
A breadcrumb.
}

Implements BreadcrumbBuilderInterface.

References BreadcrumbManager\getSortedBuilders(), and Drupal\moduleHandler().

Here is the call graph for this function:

getSortedBuilders ( )
protected

Returns the sorted array of breadcrumb builders.

Returns
[] An array of breadcrumb builder objects.

Referenced by BreadcrumbManager\build().

Here is the caller graph for this function:


The documentation for this class was generated from the following file: