class App (View source)

Properties

protected $namespacePrefix
protected $pathPrefix
protected $filters
protected $paramPatterns

Methods

static scalar
config(string $name)

Get the application configs from $_ENV with APP_ prefix key.

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

Register callable or controller for a route

setNamespace(string $prefix)

Prefixes the namespace in the current scope control

useFilter(callable $callback)

Add a filter for routes in the current scope

setPattern(string $name, string $regex)

Create or replace a pattern for URL slugs

scope(string $pattern, Closure $callback)

Groups routes within the scope of the defined URI

exec()

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

array
routes()

Get routes from current scope and parents

static bool
maintenance()

Checks if the application is in maintenance mode.

static bool
down()

Put the application into maintenance mode

static bool
up()

Bring the application out of maintenance mode

__get($name)

No description

__set($name, $value)

No description

Details

static scalar config(string $name)

Get the application configs from $_ENV with APP_ prefix key.

Parameters

string $name

Return Value

scalar

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

Register callable or controller for a route

Parameters

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

setNamespace(string $prefix)

Prefixes the namespace in the current scope control

Parameters

string $prefix

useFilter(callable $callback)

Add a filter for routes in the current scope

Parameters

callable $callback

setPattern(string $name, string $regex)

Create or replace a pattern for URL slugs

Parameters

string $name
string $regex

scope(string $pattern, Closure $callback)

Groups routes within the scope of the defined URI

Parameters

string $pattern

URI pattern

Closure $callback Callback

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