Documentation

Modules
in package

Manage module registrations.

Use this helper to retrieve information about registered modules.

The register() method is available also as Register::module() for simplicity and backward-compat.

Table of Contents

Properties

$loaded  : array<ModuleInterface>, bool>
$modules  : array<string|int, ModuleInterface>

Methods

getModule()  : null|ModuleInterface
Get a module by it's name.
getModuleByClass()  : null|ModuleInterface
Get a module by it's class name.
getModuleByPath()  : null|ModuleInterface
Find which module this path belongs to.
getModuleForClass()  : null|ModuleInterface
Find which module this class belongs to.
getModules()  : array<string|int, ModuleInterface>
Gets the list of active modules
isInstalled()  : bool
Is this module installed?
isLoaded()  : bool
Is this module loaded?
loadModule()  : void
Load a module.
loadModules()  : void
Load all modules for a given mode.
register()  : ModuleInterface
Register a module.

Properties

$loaded

private static array<ModuleInterface>, bool> $loaded = []

Methods

getModuleByClass()

Get a module by it's class name.

public static getModuleByClass(ModuleInterface> $target) : null|ModuleInterface
Parameters
$target : ModuleInterface>
Return values
null|ModuleInterface

getModuleByPath()

Find which module this path belongs to.

public static getModuleByPath(string $path) : null|ModuleInterface
Parameters
$path : string

a file path, for a class or asset

Return values
null|ModuleInterface

getModuleForClass()

Find which module this class belongs to.

public static getModuleForClass(object|string $target) : null|ModuleInterface
Parameters
$target : object|string
Return values
null|ModuleInterface

isInstalled()

Is this module installed?

public static isInstalled(string $name) : bool
Parameters
$name : string
Return values
bool

isLoaded()

Is this module loaded?

public static isLoaded(string $mode, ModuleInterface|ModuleInterface> $module) : bool
Parameters
$mode : string
$module : ModuleInterface|ModuleInterface>
Return values
bool

loadModules()

Load all modules for a given mode.

public static loadModules(string $mode) : void
Parameters
$mode : string
On this page

Search results