Requests_Hooks::dispatch()
最后更新于:2021-11-26 03:01:19
Requests_Hooks::dispatch( string$hook, array$parameters=array())Dispatch a message
参数
- $hook
-
(string) (Required) Hook name
- $parameters
-
(array) (Optional) 参数 to pass to callbacks
Default value: array()
响应
(boolean) Successfulness
源文件
文件: gc-includes/Requests/Hooks.php
public function dispatch($hook, $parameters = array()) {
if (empty($this->hooks[$hook])) {
return false;
}
foreach ($this->hooks[$hook] as $priority => $hooked) {
foreach ($hooked as $callback) {
call_user_func_array($callback, $parameters);
}
}
return true;
}