class Event implements ExtenderInterface
Methods
Add a listener to a domain event dispatched by flarum or a flarum extension.
Add a subscriber for a set of domain events dispatched by flarum or a flarum extension.
Details
at
line 33
listen(string $event, callable|string $listener)
Add a listener to a domain event dispatched by flarum or a flarum extension.
The listener can either be: - a callback function - the class attribute of a class with a public <code>handle</code> method, which accepts an instance of the event as a parameter - an array, where the first argument is an object or class name, and the second argument is the method on the first argument that should be executed as the listener
at
line 49
subscribe(string $subscriber)
Add a subscriber for a set of domain events dispatched by flarum or a flarum extension.
Event subscribers are classes that may subscribe to multiple events from within the subscriber class itself, allowing you to define several event handlers within a single class.