Controller class
| package | Default |
|---|
handleShutdown() : void
If you need to customize the handling of shutdown, please override it with subclasses.
| codeCoverageIgnore |
|---|
main(string $controller, \Kore\array<string> $args) : void
stringcontroller namespace
\Kore\array<string>path arguments
action() : void
The action is implemented in subclasses.
extractView(string $path, \Kore\array<mixed> $data = array()) : string | false
stringview file path
\Kore\array<mixed>response data
stringfalseviewgetArg(string|null $key= null, mixed $default= null) : mixed
If no key is specified, all path arguments are returned.
stringnullpath argument key
mixeddefault value if there is no value specified in the key
mixedpath argumentsgetBody() : string
stringbody datagetCookie(string|null $key= null, mixed $default= null) : mixed
If no key is specified, all cookie parameters are returned.
stringnullcookie parameter key
mixeddefault value if there is no value specified in the key
mixedcookie parametersgetFromArray(\Kore\array<mixed> $array, string|null $key= null, mixed $default= null) : mixed
If no key is specified, array is returned.
\Kore\array<mixed>array
stringnullpath key
mixeddefault value if there is no value specified in the key
mixedvaluegetHeader(string $key, mixed $default = null) : mixed
stringheader key
mixeddefault value if there is no value specified in the key
mixedhttp headergetJsonBody() : \Kore\array<mixed>
\Kore\array<mixed>body datagetMethod() : mixed
mixedhttp methodgetPost(string|null $key= null, mixed $default= null) : mixed
If no key is specified, all post parameters are returned.
stringnullpost parameter key
mixeddefault value if there is no value specified in the key
mixedpost parametersgetQuery(string|null $key= null, mixed $default= null) : mixed
If no key is specified, all query parameters are returned.
stringnullquery parameter key
mixeddefault value if there is no value specified in the key
mixedquery parametersgetServer(string|null $key= null, mixed $default= null) : mixed
If no key is specified, all server parameters are returned.
stringnullserver parameter key
mixeddefault value if there is no value specified in the key
mixedserver parametersgetUserAgent() : mixed
mixedUser AgenthandleError(\Exception $e) : void
If you need to customize the handling of errors, please override it with subclasses.
\Exceptionerrors
\Exception |
|---|
logLevel() : integer
The default is Log::LEVEL_DEBUG. If you need to customize, please override it with subclasses.
| see | \Kore\Log |
|---|
integerlog levelmoduleName() : string
The default is 'app'. If you need to customize, please override it with subclasses.
stringmodule namepreaction() : void
If you need to customize, please override it with subclasses.
redirect(string $url, integer $responseCode = 302) : void
stringredirect url
integerhttp status code, the default is 302
respondJson(\Kore\array<mixed> $data= array(), integer $responseCode= 200) : void
\Kore\array<mixed>response data
integerhttp status code, the default is 200
respondView(string $path, \Kore\array<mixed> $data= array(), integer $responseCode= 200) : void
stringview file path
\Kore\array<mixed>response data
integerhttp status code, the default is 200
$args : \Kore\array<string>
array()$body : string
$controller : string