$config
$config : mixed
Application config
This is the main class for the Popcorn Micro-Framework.
$router : \Pop\Router\Router
Application router
$services : \Pop\Service\Locator
Service locator
$events : \Pop\Event\Manager
Event manager
$modules : \Pop\Module\Manager
Module manager
bootstrap(mixed $autoloader = null) : \Pop\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
mixed | $autoloader |
addConfigValue(string $name, string $value) : \Pop\Application
Add new value to config
string | $name | |
string | $value |
updateConfigValue(string $name, string $value) : \Pop\Application
Update existing value in config
string | $name | |
string | $value |
deleteConfigValue(string $name) : \Pop\Application
Replace existing value in config
string | $name |
mergeConfig(mixed $config, boolean $preserve = false) : \Pop\Application
Merge new or altered config values with the existing config values
mixed | $config | |
boolean | $preserve |
init() : \Pop\Application
Initialize the application
router() : \Pop\Router\Router
Access the application router
services() : \Pop\Service\Locator
Get the service locator
events() : \Pop\Event\Manager
Get the event manager
modules() : \Pop\Module\Manager
Access all application module configs
registerConfig(mixed $config) : \Pop\Application
Register a new configuration with the application
mixed | $config |
registerRouter(\Pop\Router\Router $router) : \Pop\Application
Register a new router object with the application
\Pop\Router\Router | $router |
registerServices(\Pop\Service\Locator $services) : \Pop\Application
Register a new service locator object with the application
\Pop\Service\Locator | $services |
registerEvents(\Pop\Event\Manager $events) : \Pop\Application
Register a new event manager object with the application
\Pop\Event\Manager | $events |
registerModules(\Pop\Module\Manager $modules) : \Pop\Application
Register a new module manager object with the application
\Pop\Module\Manager | $modules |
registerAutoloader(mixed $autoloader) : \Pop\Application
Register the autoloader object with the application
mixed | $autoloader |
module(string $name) : \Pop\Module\ModuleInterface
Access a module object
string | $name |
register(mixed $module, string $name = null) : \Pop\Application
Register a module with the module manager object
mixed | $module | |
string | $name |
unregister(string $name) : \Pop\Application
Unregister a module with the module manager object
string | $name |
addRoute(string $route, mixed $controller) : \Pop\Application
Add a route
string | $route | |
mixed | $controller |
addRoutes(array $routes) : \Pop\Application
Add routes
array | $routes |
setService(string $name, mixed $service) : \Pop\Application
Set a service
string | $name | |
mixed | $service |
removeService(string $name) : \Pop\Application
Remove a service
string | $name |
on(string $name, mixed $action, integer $priority) : \Pop\Application
Attach an event. Default hook-points are:
app.init app.route.pre app.dispatch.pre app.dispatch.post app.error
string | $name | |
mixed | $action | |
integer | $priority |
off(string $name, mixed $action) : \Pop\Application
Detach an event. Default hook-points are:
app.init app.route.pre app.dispatch.pre app.dispatch.post app.error
string | $name | |
mixed | $action |
trigger(string $name, array $args = array()) : \Pop\Application
Trigger an event
string | $name | |
array | $args |
__set(string $name, mixed $value) : \Pop\Application
Set a pre-designated value in the application object
string | $name | |
mixed | $value |
__unset(string $name) : \Pop\Application
Unset a pre-designated value in the application object
string | $name |
offsetSet(string $offset, mixed $value) : \Pop\Application
Set a pre-designated value in the application object
string | $offset | |
mixed | $value |
offsetUnset(string $offset) : \Pop\Application
Unset a pre-designated value in the application object
string | $offset |
get(string $route, mixed $controller) : \Popcorn\Pop
Add a GET route
string | $route | |
mixed | $controller |
head(string $route, mixed $controller) : \Popcorn\Pop
Add a HEAD route
string | $route | |
mixed | $controller |
post(string $route, mixed $controller) : \Popcorn\Pop
Add a POST route
string | $route | |
mixed | $controller |
put(string $route, mixed $controller) : \Popcorn\Pop
Add a PUT route
string | $route | |
mixed | $controller |
delete(string $route, mixed $controller) : \Popcorn\Pop
Add a DELETE route
string | $route | |
mixed | $controller |
trace(string $route, mixed $controller) : \Popcorn\Pop
Add a TRACE route
string | $route | |
mixed | $controller |
options(string $route, mixed $controller) : \Popcorn\Pop
Add an OPTIONS route
string | $route | |
mixed | $controller |
connect(string $route, mixed $controller) : \Popcorn\Pop
Add a CONNECT route
string | $route | |
mixed | $controller |
patch(string $route, mixed $controller) : \Popcorn\Pop
Add a PATCH route
string | $route | |
mixed | $controller |
setRoute(string $method, string $route, mixed $controller) : \Popcorn\Pop
Add a route
string | $method | |
string | $route | |
mixed | $controller |
setRoutes(array|string $methods, string $route, mixed $controller) : \Popcorn\Pop
Add multiple routes
array|string | $methods | |
string | $route | |
mixed | $controller |
addToAll(string $route, mixed $controller) : \Popcorn\Pop
Add to all methods
string | $route | |
mixed | $controller |