Created
August 16, 2017 23:53
-
-
Save cweagans/d9ccad42e11a52ef6847d347008ddceb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$dispatcher = new EventDispatcher(); | |
$dispatcher->addListener('event.name', [any PHP Callable]); | |
$dispatcher->dispatch('event.name'); // the callable you specified above gets called. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment