ComponentRegistry
final class ComponentRegistry (View source)
Maps view-facing component names to container services and resolves them on demand.
Registrations may be extended or replaced before a component is resolved.
Methods
Initializes the registry with the container used for lazy component resolution.
Registers or replaces the service class resolved for a component name.
Reports whether a component name is currently registered.
Resolves a registered component and optionally verifies its expected implementation type.
Resolves the registered breadcrumb component.
Resolves the registered request-aware pagination component.
Resolves the registered metadata component.
Returns the current component-name to service-class mapping.
Details
__construct
__construct(ContainerInterface $container)
Initializes the registry with the container used for lazy component resolution.
register
void
register(string $name, string $componentClass)
Registers or replaces the service class resolved for a component name.
has
bool
has(string $name)
Reports whether a component name is currently registered.
get
object
get(string $name, string|null $expectedClass = null)
Resolves a registered component and optionally verifies its expected implementation type.
pagination
PaginationComponent
pagination()
Resolves the registered request-aware pagination component.
all
array
all()
Returns the current component-name to service-class mapping.