class ModuleRegistry (View source)

Loads the modules listed in the manifest and answers which are enabled for the current user.

Provides aggregated routes, navigation, and capabilities of the enabled modules.

Methods

__construct(ConfigurationInterface $config, array $moduleClasses = ModuleManifest::MODULES)

No description

void
loadModules()

Load and initialize all registered modules.

array
getEnabledModules()

No description

array
getRoutes()

Get aggregated route definitions from all enabled modules.

array
getNavItems(bool $isAdmin = false)

Get aggregated navigation items from all enabled modules.

array
getCapabilityData(string $capability, array $context = [], bool $isAdmin = false)

Get aggregated capability data from all enabled modules.

Details

__construct(ConfigurationInterface $config, array $moduleClasses = ModuleManifest::MODULES)

No description

Parameters

ConfigurationInterface $config
array $moduleClasses

Module classes by config name; the manifest by default

void loadModules()

Load and initialize all registered modules.

Checks configuration to determine which modules are enabled.

Return Value

void

array getEnabledModules()

No description

Return Value

array

array getRoutes()

Get aggregated route definitions from all enabled modules.

Return Value

array

array getNavItems(bool $isAdmin = false)

Get aggregated navigation items from all enabled modules.

Parameters

bool $isAdmin

Whether the current user is an administrator

Return Value

array

array getCapabilityData(string $capability, array $context = [], bool $isAdmin = false)

Get aggregated capability data from all enabled modules.

Parameters

string $capability

One of the ModuleInterface::CAP_* identifiers

array $context

Context for placeholder resolution (e.g., ['zone_id' => 123])

bool $isAdmin

Whether the current user is an administrator

Return Value

array