Properties

$setting

$setting

$memberConfig

$memberConfig

$memberGroup

$memberGroup

$noNeedLogin

$noNeedLogin : array

无需登录的方法,同时也就不需要鉴权了

Type

array

$noNeedRight

$noNeedRight : array

无需鉴权的方法,但需要登录

Type

array

$auth

$auth : \app\member\controller\Auth

权限Auth

Type

\app\member\controller\Auth —

$request

$request : \app\common\controller\Request

Type

\app\common\controller\Request — Request 实例

$responseType

$responseType : string

默认响应输出类型,支持json/xml

Type

string

$arr

$arr : array

生成树型结构所需要的2维数组

Type

array

Methods

__construct()

__construct(\think\App  $app) : mixed

构造方法

Parameters

\think\App $app

Returns

mixed —

config()

config() : mixed

Returns

mixed —

json()

json() : mixed

Returns

mixed —

add()

add() : mixed

Returns

mixed —

json_emote()

json_emote() : mixed

Returns

mixed —

getParentComment()

getParentComment(\addons\comments\controller\type  $id, mixed  $page) : bool

使用递归的方式查询出回复评论...效率如何俺也不清楚,能力限制了。。

Parameters

\addons\comments\controller\type $id
mixed $page

Returns

bool —

captcha()

captcha() : mixed

验证码

Returns

mixed —

initialize()

initialize() : mixed

初始化操作

Returns

mixed —

success()

success(string  $msg = '', mixed  $data = null, int  $code = 1, string  $type = null, array  $header = []) : mixed

操作成功返回的数据

Parameters

string $msg

提示信息

mixed $data

要返回的数据

int $code

错误码,默认为1

string $type

输出类型

array $header

发送的 Header 信息

Returns

mixed —

error()

error(string  $msg = '', mixed  $data = null, int  $code, string  $type = null, array  $header = []) : mixed

操作失败返回的数据

Parameters

string $msg

提示信息

mixed $data

要返回的数据

int $code

错误码,默认为0

string $type

输出类型

array $header

发送的 Header 信息

Returns

mixed —

result()

result(mixed  $msg, mixed  $data = null, int  $code, string  $type = null, array  $header = []) : void

返回封装后的 API 数据到客户端

Parameters

mixed $msg

提示信息

mixed $data

要返回的数据

int $code

错误码,默认为0

string $type

输出类型,支持json/xml/jsonp

array $header

发送的 Header 信息

Throws

\think\exception\HttpResponseException

validate()

validate(array  $data, string|array  $validate, array  $message = [], bool  $batch = false, mixed  $callback = null) : array|string|true

验证数据

Parameters

array $data

数据

string|array $validate

验证器名或者验证规则数组

array $message

提示信息

bool $batch

是否批量验证

mixed $callback

回调方法(闭包)

Throws

\think\exception\ValidateException

Returns

array|string|true —

token()

token() : mixed

Returns

mixed —

cache()

cache(mixed  $name, callable  $callback = null) : mixed

Parameters

mixed $name
callable $callback

Returns

mixed —

get_child()

get_child(mixed  $myid) : array

得到子级数组

Parameters

mixed $myid

Returns

array —

get_tree_array()

get_tree_array(mixed  $myid) : mixed

得到树型结构数组

Parameters

mixed $myid

Returns

mixed —