Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add event retrieval helper to dispatcher #52

Closed
joeholdcroft opened this issue Jun 7, 2013 · 0 comments
Closed

Add event retrieval helper to dispatcher #52

joeholdcroft opened this issue Jun 7, 2013 · 0 comments

Comments

@joeholdcroft
Copy link
Contributor

When dispatching an event, the event object must be passed in to the dispatcher. Often we want to get this out of the service container. So it makes sense to add a helper to the dispatcher to do this.

$dispatcher->dispatch(
    'eventname',
    $dispatcher->get('myevent')
);

Passing argument 1 as 'myevent' would return event.myevent from the service container. Passing nothing would return the event defined as event on the service container.

The second argument would be an array of arguments to pass to the constructor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants