Properties

$addon_path

$addon_path

$admin_list

$admin_list

$app

$app : \think\App

应用实例

Type

App

$view

$view

$addonName

$addonName

$configRange

$configRange

$infoRange

$infoRange

Methods

__construct()

__construct(mixed  $name = null) : mixed

Parameters

mixed $name

Returns

mixed —

getName()

getName() : string

Returns

string —

setName()

setName( $name) : mixed

设置插件标识

Parameters

$name

Returns

mixed —

getInfo()

getInfo(string  $name = '', mixed  $force = false) : array

读取基础配置信息

Parameters

string $name
mixed $force

Returns

array —

checkInfo()

checkInfo() : bool

检查基础配置信息是否完整

Returns

bool —

getAddonConfig()

getAddonConfig(string  $name = '', mixed  $force = false) : array|mixed|null

Parameters

string $name

可选模块名

mixed $force

Returns

array|mixed|null —

setAddonConfig()

setAddonConfig( $name = '', array  $value = []) : array

设置配置数据

Parameters

$name
array $value

Returns

array —

getFullConfig()

getFullConfig(string  $name = '') : array

获取完整配置列表.

Parameters

string $name

Returns

array —

setInfo()

setInfo( $name = '', array  $value = []) : array

设置插件信息数据.

Parameters

$name
array $value

Returns

array —

fetch()

fetch(string  $template = '', array  $vars = [], array  $replace = [], array  $config = []) : mixed

加载模板和页面输出 可以返回输出内容

Parameters

string $template

模板文件名或者内容

array $vars

模板输出变量

array $replace

替换内容

array $config

模板参数

Returns

mixed —

display()

display(string  $content, array  $vars = [], array  $replace = [], array  $config = []) : mixed

渲染内容输出

Parameters

string $content

内容

array $vars

模板输出变量

array $replace

替换内容

array $config

模板参数

Returns

mixed —

show()

show(string  $content, array  $vars = []) : mixed

渲染内容输出

Parameters

string $content

内容

array $vars

模板输出变量

Returns

mixed —

install()

install() : mixed

Returns

mixed —

uninstall()

uninstall() : mixed

Returns

mixed —

userSidenavAfter()

userSidenavAfter() : mixed

Returns

mixed —

registerInput()

registerInput() : mixed

Returns

mixed —

actionBegin()

actionBegin() : mixed

Returns

mixed —

userRegisterSuccessed()

userRegisterSuccessed(mixed  $auth) : mixed

Parameters

mixed $auth

Returns

mixed —

userDeleteSuccessed()

userDeleteSuccessed(mixed  $auth) : mixed

Parameters

mixed $auth

Returns

mixed —

success()

success(mixed  $msg = '', string  $url = null, mixed  $data = '', int  $wait = 3, array  $header = []) : void

操作成功跳转的快捷方法

Parameters

mixed $msg

提示信息

string $url

跳转的URL地址

mixed $data

返回的数据

int $wait

跳转等待时间

array $header

发送的Header信息

error()

error(mixed  $msg = '', string  $url = null, mixed  $data = '', int  $wait = 3, array  $header = []) : void

操作错误跳转的快捷方法

Parameters

mixed $msg

提示信息

string $url

跳转的URL地址

mixed $data

返回的数据

int $wait

跳转等待时间

array $header

发送的Header信息

result()

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

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

Parameters

mixed $data

要返回的数据

int $code

返回的code

mixed $msg

提示信息

string $type

返回数据格式

array $header

发送的Header信息

redirect()

redirect(string  $url, array|int  $params = [], int  $code = 302, array  $with = []) : void

URL重定向

Parameters

string $url

跳转的URL表达式

array|int $params

其它URL参数

int $code

http code

array $with

隐式传参

getResponseType()

getResponseType() : string

获取当前的response 输出类型

Returns

string —

assign()

assign(mixed  $name, mixed  $value = '') : void

模板变量赋值

Parameters

mixed $name

要显示的模板变量

mixed $value

变量的值