BreadcrumbProviderInterface
Interface for breadcrumb providers that can generate breadcrumb trails for different types of contexts (records, resources, etc.).
Providers are responsible for:
- Determining if they can handle a given context
- Generating the appropriate breadcrumb node hierarchy
- Providing the target module identifier for navigation
Subject to change until v15 LTS
Table of Contents
Methods
- generate() : array<string|int, BreadcrumbNode>
- Generates breadcrumb nodes for the given context.
- getPriority() : int
- Returns the priority of this provider.
- supports() : bool
- Determines whether this provider can handle the given context.
Methods
generate()
Generates breadcrumb nodes for the given context.
public
generate(BreadcrumbContext|null $context, ServerRequestInterface|null $request) : array<string|int, BreadcrumbNode>
Parameters
- $context : BreadcrumbContext|null
-
The breadcrumb context (can be null for virtual pages)
- $request : ServerRequestInterface|null
-
The current request for module detection
Return values
array<string|int, BreadcrumbNode> —Array of breadcrumb nodes ordered from root to current
getPriority()
Returns the priority of this provider.
public
getPriority() : int
Higher priority providers are checked first. Use this to override default providers or to establish a specific order.
Return values
int —Priority (higher = checked first)
supports()
Determines whether this provider can handle the given context.
public
supports(BreadcrumbContext|null $context) : bool
Parameters
- $context : BreadcrumbContext|null
-
The breadcrumb context (can be null for virtual pages)