\RFC7231Error

Custom error page supports

Summary

Methods
Properties
Constants
getPath()
Display()
err404()
err403()
err500()
err429()
$httpErrors
No constants found
No protected methods found
No protected properties found
N/A
getRFC()
No private properties found
N/A

Properties

$httpErrors

$httpErrors : 

Type

Methods

getPath()

getPath(  $code,   $allow_custom) : string

这个函数会自动根据注册表之中的配置结果的状态返回相对应的错误代码的页面模版文件 如果希望能够使用自定义的错误页面,需要在传递给框架的配置数据之中写入``RFC7231`` 字段的值

Parameters

$code
$allow_custom

Returns

string —

The view document file path.

Display()

Display(  $code,   $message,   $header = "Unknown",   $allow_custom = true) 

Display an error code page.

Parameters

$code
$message
$header
$allow_custom

err404()

err404(  $message = NULL,   $allow_custom = true) 

Parameters

$message
$allow_custom

err403()

err403(  $message = NULL,   $allow_custom = true) 

Parameters

$message
$allow_custom

err500()

err500(  $message = NULL,   $allow_custom = true) 

Parameters

$message
$allow_custom

err429()

err429(  $message = NULL,   $allow_custom = true) 

Parameters

$message
$allow_custom

getRFC()

getRFC(  $code,   $header = "Unknown") : string

Parameters

$code
$header

Returns

string —

The http status code header