class Event implements ExtenderInterface

Methods

listen(string $event, callable|string $listener)

<p>Add a listener to a domain event dispatched by flarum or a flarum extension.</p>

extend(Container $container, Extension $extension = null)

No description

Details

listen(string $event, callable|string $listener)

<p>Add a listener to a domain event dispatched by flarum or a flarum extension.</p>

<p>The listener can either be:</p> <ul> <li>a callback function or</li> <li>the class attribute of a class with a public <code>handle</code> method, which accepts an instance of the event as a parameter</li> </ul>

Parameters

string $event
callable|string $listener

extend(Container $container, Extension $extension = null)

Parameters

Container $container
Extension $extension