Documentation

Application extends AbstractApplication
in package
implements ArrayAccess

Application class

Tags
category

Pop

author

Nick Sagona, III dev@nolainteractive.com

copyright

Copyright (c) 2009-2021 NOLA Interactive, LLC. (http://www.nolainteractive.com)

license

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

version
3.7.0

Interfaces, Classes and Traits

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

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
throws
Exception
Return values
Application

__unset()

Unset a pre-designated value in the application object

public __unset(string $name) : Application
Parameters
$name : string
Return values
Application

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
throws
Exception
throws
Exception
throws
Exception
Return values
Application

getService()

Get a service

public getService(string $name) : mixed
Parameters
$name : string
Tags
throws
Exception
Return values
mixed

isRegistered()

Determine whether a module is registered with the application object

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

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
throws
Exception
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

registerAutoloader()

Register the autoloader object with the application

public registerAutoloader(mixed $autoloader) : Application
Parameters
$autoloader : mixed
Tags
throws
Exception
Return values
Application

run()

Run the application.

public run([bool $exit = true ][, string $forceRoute = null ]) : void
Parameters
$exit : bool = true
$forceRoute : string = null
Tags
throws
Exception
throws
Exception
throws
ReflectionException
Return values
void

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

Search results