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

Trigger event from object, not static method #737

Open
wants to merge 1 commit into
base: 5.x
Choose a base branch
from

Conversation

kristiansp
Copy link
Contributor

@kristiansp kristiansp commented Aug 13, 2020

When using behaviors to handle events, event won't fire when it is called with the static method, as the behavior is added dynamically, but when using this->trigger() it will, so I suggest to trigger it from the object itself. (If there's no specific reason to do it otherwise, perhaps all event triggers could be changed in the same way.)

Fixes #730

When using behaviors to handle events, event won't fire when it is called with the static method, as the behavior is added dynamically.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use $this->trigger() instead of Event::trigger() to make it possible to listen to events in Behaviors
1 participant