Module manager

package Default

 Methods

Constructor

__construct(array|\Traversable $modules, \Zend\EventManager\EventManagerInterface $eventManager = null

Parameters

$modules

array\Traversable

$eventManager

\Zend\EventManager\EventManagerInterface

Get the module event

getEvent() : \Zend\ModuleManager\ModuleEvent

Returns

\Zend\ModuleManager\ModuleEvent

Retrieve the event manager

getEventManager() : \Zend\EventManager\EventManagerInterface

Lazy-loads an EventManager instance if none registered.

Returns

\Zend\EventManager\EventManagerInterface

Get an array of the loaded modules.

getLoadedModules(boolean $loadModules = false) : array
inherited_from \Zend\ModuleManager\ModuleManagerInterface::getLoadedModules()

Parameters

$loadModules

boolean

If true, load modules if they're not already

Returns

arrayAn array of Module objects, keyed by module name

Get an instance of a module class by the module name

getModule(string $moduleName) : mixed

Parameters

$moduleName

string

Returns

mixed

Get the array of module names that this manager should load.

getModules() : array
inherited_from \Zend\ModuleManager\ModuleManagerInterface::getModules()

Returns

array

Load a specific module by name.

loadModule(string|array $module) : mixed
triggers loadModule.resolve
triggers loadModule
inherited_from \Zend\ModuleManager\ModuleManagerInterface::loadModule()

Parameters

$module

stringarray

Exceptions

\Zend\ModuleManager\Exception\RuntimeException

Returns

mixedModule's Module class

Load the provided modules.

loadModules() : \Zend\ModuleManager\ModuleManager
triggers loadModules
triggers loadModules.post
inherited_from \Zend\ModuleManager\ModuleManagerInterface::loadModules()

Returns

\Zend\ModuleManager\ModuleManager

Handle the loadModules event

onLoadModules() : void

Set the module event

setEvent(\Zend\ModuleManager\ModuleEvent $event) : \Zend\ModuleManager\ModuleManager

Parameters

$event

\Zend\ModuleManager\ModuleEvent

Returns

\Zend\ModuleManager\ModuleManager

Set the event manager instance used by this module manager.

setEventManager(\Zend\EventManager\EventManagerInterface $events) : \Zend\ModuleManager\ModuleManager

Parameters

$events

\Zend\EventManager\EventManagerInterface

Returns

\Zend\ModuleManager\ModuleManager

Set an array or Traversable of module names that this module manager should load.

setModules(mixed $modules) : \Zend\ModuleManager\ModuleManager
inherited_from \Zend\ModuleManager\ModuleManagerInterface::setModules()

Parameters

$modules

mixed

array or Traversable of module names

Exceptions

\Zend\ModuleManager\Exception\InvalidArgumentException

Returns

\Zend\ModuleManager\ModuleManager

Register the default event listeners

attachDefaultListeners() : \Zend\ModuleManager\ModuleManager

Returns

\Zend\ModuleManager\ModuleManager

Load a module with the name

loadModuleByName(\Zend\EventManager\EventInterface $event) : mixed

Parameters

$event

\Zend\EventManager\EventInterface

Exceptions

\Zend\ModuleManager\Exception\RuntimeException

Returns

mixedmodule instance

 Properties

 

$event

$event : \Zend\ModuleManager\ModuleEvent

Default

 

$events

$events : \Zend\EventManager\EventManagerInterface

Default

 

$loadFinished

$loadFinished : boolean

Default

 

An array of Module classes of loaded modules

$loadedModules : array

Default

array()
 

modules

$modules : array | \Traversable

Default

array()
 

True if modules have already been loaded

$modulesAreLoaded : boolean

Default

false

 Constants

 

EVENT_BOOTSTRAP

EVENT_BOOTSTRAP = 'bootstrap'