App
class App (View source)
Properties
| protected | $namespacePrefix | ||
| protected | $pathPrefix | ||
| protected | $filters | ||
| protected | $paramPatterns |
Methods
Get the application configs from $_ENV with APP_ prefix key.
Register callable or controller for a route
Prefixes the namespace in the current scope control
Add a filter for routes in the current scope
Create or replace a pattern for URL slugs
Executes the route callback corresponding to the path,
otherwise executes system/errors.php.
Get routes from current scope and parents
Checks if the application is in maintenance mode.
Put the application into maintenance mode
Bring the application out of maintenance mode
No description
No description
Details
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.
Note: the result is affected by the main event when maintenance mode is active.
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