Skip to content

Instantly share code, notes, and snippets.

@akadlec
Created December 28, 2016 15:46
Show Gist options
  • Save akadlec/822195e33ff673182881821d47ea7213 to your computer and use it in GitHub Desktop.
Save akadlec/822195e33ff673182881821d47ea7213 to your computer and use it in GitHub Desktop.
class SomeService
{
/**
* @var \Kdyby\Events\EventManager
*/
private $eventManager;
protected function configure()
{
//...
$this->eventManager->dispatchEvent('event.name.some', new \Kdyby\Events\EventArgsList([$this]));
}
}
final class SomeListener implements \Kdyby\Events\Subscriber
{
public function getSubscribedEvents() : array
{
return [
'event.name.some' => 'onConfigure',
];
}
public function onConfigure()
{
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment