\Charcoal\AppApp

Charcoal App

This is the primary class with which you instantiate, configure, and run a Slim Framework application within Charcoal.

Summary

Methods
Properties
Constants
instance()
__construct()
run()
No public properties found
No constants found
moduleManager()
routeManager()
setupRoutables()
$instance
N/A
__clone()
__wakeup()
setup()
$moduleManager
$routeManager
N/A

Properties

$instance

$instance : \Charcoal\App\App

Store the unique instance

Type

\Charcoal\App\App

Methods

instance()

instance(\Charcoal\App\Container|array  $container = array()) : self

Getter for creating/returning the unique instance of this class.

Parameters

\Charcoal\App\Container|array $container

The application's settings.

Returns

self

__construct()

__construct(\Charcoal\App\ContainerInterface|array  $container = array()) 

Create new Charcoal application (and SlimApp).

Dependencies

Required

  • config — AppConfig

Optional

  • logger — PSR-3 Logger

Parameters

\Charcoal\App\ContainerInterface|array $container

The application's settings.

Throws

\LogicException

If trying to create a new instance of a singleton.

run()

run(boolean  $silent = false) : \Psr\Http\Message\ResponseInterface

Run application.

Initialize the Charcoal application before running (with SlimApp).

Parameters

boolean $silent

If true, will run in silent mode (no response).

Returns

\Psr\Http\Message\ResponseInterface —

The PSR7 HTTP response.

setupRoutables()

setupRoutables() : void

Setup the application's "global" routables.

Routables can only be defined globally (app-level) for now.

__clone()

__clone() : void

Throws

\LogicException

If trying to clone an instance of a singleton.

__wakeup()

__wakeup() : void

Throws

\LogicException

If trying to unserialize an instance of a singleton.

setup()

setup() : void

Registers the default services and features that Charcoal needs to work.