\Hook

Summary

Methods
Properties
Constants
add()
import()
get()
listen()
exec()
parseName()
$usetag
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$tags
N/A

Properties

$usetag

$usetag

$tags

$tags

Methods

add()

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

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

Parameters

string $tag

标签名称

mixed $behavior

行为名称

bool $first

是否放到开头执行

import()

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

批量导入插件

Parameters

array $tags

插件信息

bool $recursive

是否递归合并

Returns

mixed —

get()

get(string  $tag = '') : array

获取插件信息

Parameters

string $tag

插件位置 留空获取全部

Returns

array —

listen()

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

监听标签的行为

Parameters

string $tag

标签名称

mixed $params

传入参数

mixed $extra

额外参数

bool $once

只获取一个有效返回值

Returns

mixed —

exec()

exec(mixed  $class, string  $tag = '', mixed  $params = null, mixed  $extra = null, mixed  $break) : mixed

执行某个行为

Parameters

mixed $class

要执行的行为

string $tag

方法名(标签名)

mixed $params

传人的参数

mixed $extra

额外参数

mixed $break

Returns

mixed —

parseName()

parseName(mixed  $name, mixed  $type, mixed  $ucfirst = true) : mixed

Parameters

mixed $name
mixed $type
mixed $ucfirst

Returns

mixed —