Hooks
in package
implements
HookManager
Handles adding and dispatching events
Table of Contents
Interfaces
- HookManager
- Event dispatcher
Properties
- $hooks : array<string|int, mixed>
- Registered callbacks for each hook
Methods
- dispatch() : bool
- Dispatch a message
- register() : mixed
- Register a callback for a hook
Properties
$hooks
Registered callbacks for each hook
protected
array<string|int, mixed>
$hooks
= []
Methods
dispatch()
Dispatch a message
public
dispatch(string $hook[, array<string|int, mixed> $parameters = [] ]) : bool
Parameters
- $hook : string
-
Hook name
- $parameters : array<string|int, mixed> = []
-
Parameters to pass to callbacks
Tags
Return values
bool —Successfulness
register()
Register a callback for a hook
public
register(string $hook, callable $callback[, int $priority = 0 ]) : mixed
Parameters
- $hook : string
-
Hook name
- $callback : callable
-
Function/method to call on event
- $priority : int = 0
-
Priority number. <0 is executed earlier, >0 is executed later