Application
extends AbstractApplication
in package
implements
ArrayAccess
Application class
Tags
Interfaces, Classes, Traits and Enums
- ArrayAccess
Table of Contents
- $config : mixed
- Application config
- $autoloader : mixed
- Autoloader
- $config : mixed
- Application config
- $events : Manager
- Event manager
- $modules : Manager
- Module manager
- $router : Router
- Application router
- $services : Locator
- Service locator
- __construct() : mixed
- Constructor
- __get() : mixed
- Get a pre-designated value from the application object
- __isset() : bool
- Determine if a pre-designated value in the application object exists
- __set() : Application
- Set a pre-designated value in the application object
- __unset() : Application
- Unset a pre-designated value in the application object
- addConfigValue() : AbstractApplication
- Add new value to config
- addRoute() : Application
- Add a route
- addRoutes() : Application
- Add routes
- autoloader() : mixed
- Get the autoloader object
- bootstrap() : Application
- Bootstrap the application, creating the required objects if they haven't been created yet and registering with the autoloader, adding routes, services and events
- config() : mixed
- Access application config
- deleteConfigValue() : AbstractApplication
- Replace existing value in config
- events() : Manager
- Get the event manager
- getService() : mixed
- Get a service
- init() : Application
- Initialize the application
- isRegistered() : bool
- Determine whether a module is registered with the application object
- mergeConfig() : AbstractApplication
- Merge new or altered config values with the existing config values
- module() : ModuleInterface
- Access a module object
- modules() : Manager
- Access all application module configs
- off() : Application
- Detach an event. Default hook-points are:
- offsetExists() : bool
- Determine if a pre-designated value in the application object exists
- offsetGet() : mixed
- Get a pre-designated value from the application object
- offsetSet() : Application
- Set a pre-designated value in the application object
- offsetUnset() : Application
- Unset a pre-designated value in the application object
- on() : Application
- Attach an event. Default hook-points are:
- register() : Application
- Register a module with the module manager object
- registerAutoloader() : Application
- Register the autoloader object with the application
- registerConfig() : AbstractApplication
- Register a new configuration with the application
- registerEvents() : Application
- Register a new event manager object with the application
- registerModules() : Application
- Register a new module manager object with the application
- registerRouter() : Application
- Register a new router object with the application
- registerServices() : Application
- Register a new service locator object with the application
- removeService() : Application
- Remove a service
- router() : Router
- Access the application router
- run() : void
- Run the application.
- services() : Locator
- Get the service locator
- setService() : Application
- Set a service
- trigger() : Application
- Trigger an event
- unregister() : Application
- Unregister a module with the module manager object
- updateConfigValue() : AbstractApplication
- Update existing value in config
Properties
$config
Application config
public
mixed
$config
mixed
$autoloader
Autoloader
protected
mixed
$autoloader
= null
$config
Application config
protected
mixed
$config
= null
$events
Event manager
protected
Manager
$events
= null
$modules
Module manager
protected
Manager
$modules
= null
$router
Application router
protected
Router
$router
= null
$services
Service locator
protected
Locator
$services
= null
Methods
__construct()
Constructor
public
__construct() : mixed
Instantiate an application object
Optional parameters are a service locator instance, a router instance, an event manager instance or a configuration object or array
Return values
mixed —__get()
Get a pre-designated value from the application object
public
__get(string $name) : mixed
Parameters
- $name : string
Return values
mixed —__isset()
Determine if a pre-designated value in the application object exists
public
__isset(string $name) : bool
Parameters
- $name : string
Return values
bool —__set()
Set a pre-designated value in the application object
public
__set(string $name, mixed $value) : Application
Parameters
- $name : string
- $value : mixed
Tags
Return values
Application —__unset()
Unset a pre-designated value in the application object
public
__unset(string $name) : Application
Parameters
- $name : string
Return values
Application —addConfigValue()
Add new value to config
public
addConfigValue(string $name, string $value) : AbstractApplication
Parameters
- $name : string
- $value : string
Return values
AbstractApplication —addRoute()
Add a route
public
addRoute(string $route, mixed $controller) : Application
Parameters
- $route : string
- $controller : mixed
Return values
Application —addRoutes()
Add routes
public
addRoutes(array<string|int, mixed> $routes) : Application
Parameters
- $routes : array<string|int, mixed>
Return values
Application —autoloader()
Get the autoloader object
public
autoloader() : mixed
Return values
mixed —bootstrap()
Bootstrap the application, creating the required objects if they haven't been created yet and registering with the autoloader, adding routes, services and events
public
bootstrap([mixed $autoloader = null ]) : Application
Parameters
- $autoloader : mixed = null
Tags
Return values
Application —config()
Access application config
public
config() : mixed
Return values
mixed —deleteConfigValue()
Replace existing value in config
public
deleteConfigValue(string $name) : AbstractApplication
Parameters
- $name : string
Return values
AbstractApplication —events()
Get the event manager
public
events() : Manager
Return values
Manager —getService()
Get a service
public
getService(string $name) : mixed
Parameters
- $name : string
Tags
Return values
mixed —init()
Initialize the application
public
init() : Application
Tags
Return values
Application —isRegistered()
Determine whether a module is registered with the application object
public
isRegistered(string $name) : bool
Parameters
- $name : string
Return values
bool —mergeConfig()
Merge new or altered config values with the existing config values
public
mergeConfig(mixed $config[, bool $preserve = false ]) : AbstractApplication
Parameters
- $config : mixed
- $preserve : bool = false
Tags
Return values
AbstractApplication —module()
Access a module object
public
module(string $name) : ModuleInterface
Parameters
- $name : string
Return values
ModuleInterface —modules()
Access all application module configs
public
modules() : Manager
Return values
Manager —off()
Detach an event. Default hook-points are:
public
off(string $name, mixed $action) : Application
app.init app.route.pre app.dispatch.pre app.dispatch.post app.error
Parameters
- $name : string
- $action : mixed
Return values
Application —offsetExists()
Determine if a pre-designated value in the application object exists
public
offsetExists(string $offset) : bool
Parameters
- $offset : string
Return values
bool —offsetGet()
Get a pre-designated value from the application object
public
offsetGet(string $offset) : mixed
Parameters
- $offset : string
Return values
mixed —offsetSet()
Set a pre-designated value in the application object
public
offsetSet(string $offset, mixed $value) : Application
Parameters
- $offset : string
- $value : mixed
Tags
Return values
Application —offsetUnset()
Unset a pre-designated value in the application object
public
offsetUnset(string $offset) : Application
Parameters
- $offset : string
Return values
Application —on()
Attach an event. Default hook-points are:
public
on(string $name, mixed $action, int $priority) : Application
app.init app.route.pre app.dispatch.pre app.dispatch.post app.error
Parameters
- $name : string
- $action : mixed
- $priority : int
Return values
Application —register()
Register a module with the module manager object
public
register(mixed $module[, string $name = null ]) : Application
Parameters
- $module : mixed
- $name : string = null
Tags
Return values
Application —registerAutoloader()
Register the autoloader object with the application
public
registerAutoloader(mixed $autoloader) : Application
Parameters
- $autoloader : mixed
Tags
Return values
Application —registerConfig()
Register a new configuration with the application
public
registerConfig(mixed $config) : AbstractApplication
Parameters
- $config : mixed
Tags
Return values
AbstractApplication —registerEvents()
Register a new event manager object with the application
public
registerEvents(Manager $events) : Application
Parameters
- $events : Manager
Return values
Application —registerModules()
Register a new module manager object with the application
public
registerModules(Manager $modules) : Application
Parameters
- $modules : Manager
Return values
Application —registerRouter()
Register a new router object with the application
public
registerRouter(Router $router) : Application
Parameters
- $router : Router
Return values
Application —registerServices()
Register a new service locator object with the application
public
registerServices(Locator $services) : Application
Parameters
- $services : Locator
Return values
Application —removeService()
Remove a service
public
removeService(string $name) : Application
Parameters
- $name : string
Return values
Application —router()
Access the application router
public
router() : Router
Return values
Router —run()
Run the application.
public
run([bool $exit = true ][, string $forceRoute = null ]) : void
Parameters
- $exit : bool = true
- $forceRoute : string = null
Tags
Return values
void —services()
Get the service locator
public
services() : Locator
Return values
Locator —setService()
Set a service
public
setService(string $name, mixed $service) : Application
Parameters
- $name : string
- $service : mixed
Tags
Return values
Application —trigger()
Trigger an event
public
trigger(string $name[, array<string|int, mixed> $args = [] ]) : Application
Parameters
- $name : string
- $args : array<string|int, mixed> = []
Return values
Application —unregister()
Unregister a module with the module manager object
public
unregister(string $name) : Application
Parameters
- $name : string
Return values
Application —updateConfigValue()
Update existing value in config
public
updateConfigValue(string $name, string $value) : AbstractApplication
Parameters
- $name : string
- $value : string