\thinkHttp

Web应用管理类

Summary

Methods
Properties
Constants
__construct()
name()
getName()
path()
getPath()
getRoutePath()
setRoutePath()
setBind()
isBind()
run()
end()
No public properties found
No constants found
initialize()
runWithRequest()
dispatchToRoute()
loadMiddleware()
loadRoutes()
reportException()
renderException()
$app
$name
$path
$isBind
N/A
No private methods found
No private properties found
N/A

Properties

$name

$name : string

应用名称

Type

string

$path

$path : string

应用路径

Type

string

$isBind

$isBind : boolean

是否绑定应用

Type

boolean

Methods

__construct()

__construct(\think\App  $app) 

Parameters

\think\App $app

name()

name(string  $name) : $this

设置应用名称

Parameters

string $name

应用名称

Returns

$this

getName()

getName() : string

获取应用名称

Returns

string

path()

path(string  $path) : $this

设置应用目录

Parameters

string $path

应用目录

Returns

$this

getPath()

getPath() : string

获取应用路径

Returns

string

getRoutePath()

getRoutePath() : string

获取路由目录

Returns

string

setRoutePath()

setRoutePath(string  $path) : string

设置路由目录

Parameters

string $path

路由定义目录

Returns

string

setBind()

setBind(boolean  $bind = true) : $this

设置应用绑定

Parameters

boolean $bind

是否绑定

Returns

$this

isBind()

isBind() : boolean

是否绑定应用

Returns

boolean

run()

run(\think\Request|null  $request = null) : \think\Response

执行应用程序

Parameters

\think\Request|null $request

Returns

\think\Response

end()

end(\think\Response  $response) : void

HttpEnd

Parameters

\think\Response $response

initialize()

initialize() 

初始化

runWithRequest()

runWithRequest(\think\Request  $request) : mixed

执行应用程序

Parameters

\think\Request $request

Returns

mixed

dispatchToRoute()

dispatchToRoute(  $request) 

Parameters

$request

loadMiddleware()

loadMiddleware() 

加载全局中间件

loadRoutes()

loadRoutes() : void

加载路由

reportException()

reportException(\Throwable  $e) : void

Report the exception to the exception handler.

Parameters

\Throwable $e

renderException()

renderException(\think\Request  $request, \Throwable  $e) : \think\Response

Render the exception to a response.

Parameters

\think\Request $request
\Throwable $e

Returns

\think\Response