class App extends App (View source)

Properties

protected $namespacePrefix from  App
protected $pathPrefix from  App
protected $filters from  App
protected $paramPatterns from  App

Methods

static scalar
config(string $name)

Validate name and get the application configs from $_ENV with APP_ prefix key.

action(string|array $methods, string $path, string|callable $callback)

Validate method and callback, if valid register callable or controller for a route

setNamespace(string $prefix)

Validate namespace prefix, if valid define controller prefix on scope

useFilter(callable $callback)

Add a filter for routes in the current scope

from  App
setPattern(string $name, string $regex)

Validate pattern, if valid create or replace a pattern for URL slugs

scope(string $pattern, Closure $callback)

Validate URL pattern, if valid register a callback for isolate routes

exec()

Executes the route callback corresponding to the path, otherwise executes system/errors.php.

from  App
array
routes()

Get routes from current scope and parents

from  App
static bool
maintenance()

Checks if the application is in maintenance mode.

from  App
static bool
down()

Put the application into maintenance mode

from  App
static bool
up()

Bring the application out of maintenance mode

from  App
__get($name)

No description

__set($name, $value)

No description

__construct()

No description

Details

static scalar config(string $name)

Validate name and get the application configs from $_ENV with APP_ prefix key.

Parameters

string $name

Return Value

scalar

Exceptions

Exception

action(string|array $methods, string $path, string|callable $callback)

Validate method and callback, if valid register callable or controller for a route

Parameters

string|array $methods
string $path
string|callable $callback

Exceptions

Exception

setNamespace(string $prefix)

Validate namespace prefix, if valid define controller prefix on scope

Parameters

string $prefix

Exceptions

Exception

useFilter(callable $callback)

Add a filter for routes in the current scope

Parameters

callable $callback

setPattern(string $name, string $regex)

Validate pattern, if valid create or replace a pattern for URL slugs

Parameters

string $name
string $regex

Exceptions

Exception

scope(string $pattern, Closure $callback)

Validate URL pattern, if valid register a callback for isolate routes

Parameters

string $pattern

URI pattern

Closure $callback Callback

Exceptions

Exception

exec()

Executes the route callback corresponding to the path, otherwise executes system/errors.php.

array routes()

Get routes from current scope and parents

Return Value

array

static bool maintenance()

Checks if the application is in maintenance mode.

Note: the result is affected by the main event when maintenance mode is active.

Return Value

bool

static bool down()

Put the application into maintenance mode

Return Value

bool

static bool up()

Bring the application out of maintenance mode

Return Value

bool

__get($name)

No description

Parameters

$name

__set($name, $value)

No description

Parameters

$name
$value

__construct()

No description