class SystemBreadcrumbBlock
Same name in other branches
- 9 core/modules/system/src/Plugin/Block/SystemBreadcrumbBlock.php \Drupal\system\Plugin\Block\SystemBreadcrumbBlock
- 10 core/modules/system/src/Plugin/Block/SystemBreadcrumbBlock.php \Drupal\system\Plugin\Block\SystemBreadcrumbBlock
- 11.x core/modules/system/src/Plugin/Block/SystemBreadcrumbBlock.php \Drupal\system\Plugin\Block\SystemBreadcrumbBlock
Provides a block to display the breadcrumbs.
Plugin annotation
@Block(
id = "system_breadcrumb_block",
admin_label = @Translation("Breadcrumbs")
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements \Drupal\Component\Plugin\PluginInspectionInterface, \Drupal\Component\Plugin\DerivativeInspectionInterface
- class \Drupal\Component\Plugin\ContextAwarePluginBase extends \Drupal\Component\Plugin\PluginBase implements \Drupal\Component\Plugin\ContextAwarePluginInterface
- class \Drupal\Core\Plugin\ContextAwarePluginBase extends \Drupal\Component\Plugin\ContextAwarePluginBase implements \Drupal\Core\Plugin\ContextAwarePluginInterface, \Drupal\Core\Cache\CacheableDependencyInterface uses \Drupal\Core\TypedData\TypedDataTrait, \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait
- class \Drupal\Core\Block\BlockBase extends \Drupal\Core\Plugin\ContextAwarePluginBase implements \Drupal\Core\Block\BlockPluginInterface, \Drupal\Core\Plugin\PluginWithFormsInterface, \Drupal\Core\Render\PreviewFallbackInterface uses \Drupal\Core\Block\BlockPluginTrait, \Drupal\Core\Plugin\ContextAwarePluginAssignmentTrait
- class \Drupal\system\Plugin\Block\SystemBreadcrumbBlock extends \Drupal\Core\Block\BlockBase implements \Drupal\Core\Plugin\ContainerFactoryPluginInterface
- class \Drupal\Core\Block\BlockBase extends \Drupal\Core\Plugin\ContextAwarePluginBase implements \Drupal\Core\Block\BlockPluginInterface, \Drupal\Core\Plugin\PluginWithFormsInterface, \Drupal\Core\Render\PreviewFallbackInterface uses \Drupal\Core\Block\BlockPluginTrait, \Drupal\Core\Plugin\ContextAwarePluginAssignmentTrait
- class \Drupal\Core\Plugin\ContextAwarePluginBase extends \Drupal\Component\Plugin\ContextAwarePluginBase implements \Drupal\Core\Plugin\ContextAwarePluginInterface, \Drupal\Core\Cache\CacheableDependencyInterface uses \Drupal\Core\TypedData\TypedDataTrait, \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait
- class \Drupal\Component\Plugin\ContextAwarePluginBase extends \Drupal\Component\Plugin\PluginBase implements \Drupal\Component\Plugin\ContextAwarePluginInterface
Expanded class hierarchy of SystemBreadcrumbBlock
File
-
core/
modules/ system/ src/ Plugin/ Block/ SystemBreadcrumbBlock.php, line 19
Namespace
Drupal\system\Plugin\BlockView source
class SystemBreadcrumbBlock extends BlockBase implements ContainerFactoryPluginInterface {
/**
* The breadcrumb manager.
*
* @var \Drupal\Core\Breadcrumb\BreadcrumbBuilderInterface
*/
protected $breadcrumbManager;
/**
* The current route match.
*
* @var \Drupal\Core\Routing\RouteMatchInterface
*/
protected $routeMatch;
/**
* Constructs a new SystemBreadcrumbBlock object.
*
* @param array $configuration
* A configuration array containing information about the plugin instance.
* @param string $plugin_id
* The plugin_id for the plugin instance.
* @param mixed $plugin_definition
* The plugin implementation definition.
* @param \Drupal\Core\Breadcrumb\BreadcrumbBuilderInterface $breadcrumb_manager
* The breadcrumb manager.
* @param \Drupal\Core\Routing\RouteMatchInterface $route_match
* The current route match.
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition, BreadcrumbBuilderInterface $breadcrumb_manager, RouteMatchInterface $route_match) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->breadcrumbManager = $breadcrumb_manager;
$this->routeMatch = $route_match;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static($configuration, $plugin_id, $plugin_definition, $container->get('breadcrumb'), $container->get('current_route_match'));
}
/**
* {@inheritdoc}
*/
public function build() {
return $this->breadcrumbManager
->build($this->routeMatch)
->toRenderable();
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overriden Title |
---|---|---|---|---|
SystemBreadcrumbBlock::$breadcrumbManager | protected | property | The breadcrumb manager. | |
SystemBreadcrumbBlock::$routeMatch | protected | property | The current route match. | |
SystemBreadcrumbBlock::build | public | function | ||
SystemBreadcrumbBlock::create | public static | function | Creates an instance of the plugin. | Overrides ContainerFactoryPluginInterface::create |
SystemBreadcrumbBlock::__construct | public | function | Constructs a new SystemBreadcrumbBlock object. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.