\think\facadeHook

Summary

Methods
Properties
Constants
bind()
instance()
make()
__callStatic()
alias()
add()
import()
get()
listen()
exec()
No public properties found
No constants found
createFacade()
getFacadeClass()
$bind
$alwaysNewInstance
N/A
No private methods found
No private properties found
N/A

Properties

$bind

$bind : array

绑定对象

Type

array

$alwaysNewInstance

$alwaysNewInstance : bool

始终创建新的对象实例

Type

bool

Methods

bind()

bind(string|array  $name, string  $class = null) : object

绑定类的静态代理

Parameters

string|array $name

类标识

string $class

类名

Returns

object —

instance()

instance(mixed  ...$args) : mixed

带参数实例化当前Facade类

Parameters

mixed $args variadic

Returns

mixed —

make()

make(string  $class, array|true  $args = [], bool  $newInstance = false) : mixed

调用类的实例

Parameters

string $class

类名或者标识

array|true $args

变量

bool $newInstance

是否每次创建新的实例

Returns

mixed —

__callStatic()

__callStatic(mixed  $method, mixed  $params) : mixed

Parameters

mixed $method
mixed $params

Returns

mixed —

alias()

alias(mixed  $name, mixed  $behavior = null) : \think\Hook

static 指定行为标识

Parameters

mixed $name
mixed $behavior = null

Returns

\think\Hook —

add()

add(string  $tag, mixed  $behavior, bool  $first = false) : void

static 动态添加行为扩展到某个标签

Parameters

string $tag
mixed $behavior
bool $first = false

import()

import(array  $tags, bool  $recursive = true) : void

static 批量导入插件

Parameters

array $tags
bool $recursive = true

get()

get(string  $tag = '') : array

static 获取插件信息

Parameters

string $tag = ''

Returns

array —

listen()

listen(string  $tag, mixed  $params = null, bool  $once = false) : mixed

static 监听标签的行为

Parameters

string $tag
mixed $params = null
bool $once = false

Returns

mixed —

exec()

exec(mixed  $class, mixed  $params = null) : mixed

static 执行行为

Parameters

mixed $class
mixed $params = null

Returns

mixed —

createFacade()

createFacade(string  $class = '', array  $args = [], bool  $newInstance = false) : object

创建Facade实例

Parameters

string $class

类名或标识

array $args

变量

bool $newInstance

是否每次创建新的实例

Returns

object —

getFacadeClass()

getFacadeClass() : string

获取当前Facade对应类名(或者已经绑定的容器对象标识)

Returns

string —