Documentation

Module extends AbstractModule
in package
implements ArrayAccess

Pop module class

Tags
category

Pop

author

Nick Sagona, III nick@popphp.org

copyright

Copyright (c) 2009-2026 Nick Sagona, III

license

https://www.popphp.org/license New BSD License

version
5.0.0

Table of Contents

Interfaces

ArrayAccess

Properties

$config  : mixed
$application  : Application|null
Application
$fullName  : string|null
Full Name (Human-readable, e.g., "My Application")
$name  : string|null
Name (Slug, e.g. "my-app")
$version  : string|null
Version

Methods

__construct()  : mixed
Constructor
__get()  : mixed
Get a pre-designated value from the module object
__isset()  : bool
Determine if a pre-designated value in the module object exists
__set()  : void
Set a pre-designated value in the module object
__unset()  : void
Unset a pre-designated value in the module object
addConfigValue()  : AbstractApplication
Add new value to config
application()  : Application
Get application
config()  : mixed
Access application config
deleteConfigValue()  : AbstractApplication
Replace existing value in config
getFullName()  : string
Get full name
getName()  : string
Get name
getVersion()  : string
Get version
hasFullName()  : bool
Determine if the full name is set
hasName()  : bool
Determine if the name is set
hasVersion()  : bool
Determine if version has been set
isRegistered()  : bool
Determine if the module has been registered with an application object
load()  : AbstractApplication
Optional method that can be used to load custom operations/configurations for an application to run
mergeConfig()  : AbstractApplication
Merge new or altered config values with the existing config values
offsetExists()  : bool
Determine if a value exists
offsetGet()  : mixed
Get a value from the array
offsetSet()  : void
Set a value in the array
offsetUnset()  : void
Unset a value from the array
register()  : static
Register module
registerConfig()  : AbstractApplication
Register a new configuration with the application
setFullName()  : static
Set full name
setName()  : static
Set name
setVersion()  : static
Set version
updateConfigValue()  : AbstractApplication
Update existing value in config
applyConfigEvents()  : void
If events are set in the module config, register them with the application
applyConfigMetadata()  : void
Set the module name and version from config, if available
applyConfigMiddleware()  : void
If middleware is defined in the module config, register them with the application
applyConfigRoutes()  : void
If routes are set in the module config, register them with the application
applyConfigServices()  : void
If services are set in the module config, register them with the application
registerConfiguredAutoloaderPrefix()  : void
If the autoloader is set and the module config has a defined prefix and src, register the module with the autoloader

Properties

$fullName

Full Name (Human-readable, e.g., "My Application")

protected string|null $fullName = null

Methods

__construct()

Constructor

public __construct() : mixed

Instantiate a module object

Optional parameters are an application instance or a configuration object or array

__get()

Get a pre-designated value from the module object

public __get(string $name) : mixed
Parameters
$name : string

__isset()

Determine if a pre-designated value in the module object exists

public __isset(string $name) : bool
Parameters
$name : string
Return values
bool

__set()

Set a pre-designated value in the module object

public __set(string $name, mixed $value) : void
Parameters
$name : string
$value : mixed

__unset()

Unset a pre-designated value in the module object

public __unset(string $name) : void
Parameters
$name : string

hasFullName()

Determine if the full name is set

public hasFullName() : bool
Return values
bool

hasVersion()

Determine if version has been set

public hasVersion() : bool
Return values
bool

isRegistered()

Determine if the module has been registered with an application object

public isRegistered() : bool
Return values
bool

mergeConfig()

Merge new or altered config values with the existing config values

public mergeConfig(mixed $config[, bool $preserve = false ][, array<string|int, mixed> $exclude = [] ]) : AbstractApplication
Parameters
$config : mixed
$preserve : bool = false
$exclude : array<string|int, mixed> = []
Tags
throws
Exception
Return values
AbstractApplication

offsetExists()

Determine if a value exists

public offsetExists(mixed $offset) : bool
Parameters
$offset : mixed
Return values
bool

offsetGet()

Get a value from the array

public offsetGet(mixed $offset) : mixed
Parameters
$offset : mixed

offsetSet()

Set a value in the array

public offsetSet(mixed $offset, mixed $value) : void
Parameters
$offset : mixed
$value : mixed

offsetUnset()

Unset a value from the array

public offsetUnset(mixed $offset) : void
Parameters
$offset : mixed

setFullName()

Set full name

public setFullName(string $fullName) : static
Parameters
$fullName : string
Return values
static

setName()

Set name

public setName(string $name) : static
Parameters
$name : string
Return values
static

setVersion()

Set version

public setVersion(string $version) : static
Parameters
$version : string
Return values
static

applyConfigEvents()

If events are set in the module config, register them with the application

protected applyConfigEvents() : void

applyConfigMetadata()

Set the module name and version from config, if available

protected applyConfigMetadata() : void

applyConfigMiddleware()

If middleware is defined in the module config, register them with the application

protected applyConfigMiddleware() : void

applyConfigRoutes()

If routes are set in the module config, register them with the application

protected applyConfigRoutes() : void

applyConfigServices()

If services are set in the module config, register them with the application

protected applyConfigServices() : void

registerConfiguredAutoloaderPrefix()

If the autoloader is set and the module config has a defined prefix and src, register the module with the autoloader

protected registerConfiguredAutoloaderPrefix() : void

        
On this page

Search results