5

I have PluginA that needs to listen for something that PluginB does. PluginB needs to include a Model in the event data so that PluginA (and any other subscriber) can pick that up and do whatever it needs to do.

Is that possible right now?

5

Yes. It's not documented, but by instantiating the Event class (which is just a thin wrapper for Yii's CEvent) you can create and raise your own events. Obviously you could extend the Event class as well, if need be.

See Aaron Berkowitz' excellent answer to a similar question for details -> https://craftcms.stackexchange.com/a/6941/1098

Also, check out the following resource for more on events in Yii: http://www.yiiframework.com/wiki/327/events-explained

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.