<p>Yes. It's not documented, but by instantiating the <a href="http://buildwithcraft.com/classreference/etc/events/Event" rel="nofollow noreferrer">Event class</a> (which is just a thin wrapper for <a href="http://www.yiiframework.com/doc/api/1.1/CEvent" rel="nofollow noreferrer">Yii's CEvent</a>) you can create and raise your own events. Obviously you could extend the Event class as well, if need be.</p>

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

<p>Also, check out the following resource for more on events in Yii: <a href="http://www.yiiframework.com/wiki/327/events-explained" rel="nofollow noreferrer">http://www.yiiframework.com/wiki/327/events-explained</a></p>

CC BY-SA 3.0
2015-03-26T21:04:26.177Z
2015-03-26T21:04:26.177Z
2017-04-13T12:50:59.930Z
Mats Mikkel Rummelhoff
<p>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.</p>

<p>Is that possible right now?</p>

<plugin-development><events>
Can a plugin fire a custom event?
# Can a plugin fire a custom event?

(Asked by: username_0 on 2015-03-26)

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?

**Tags:** plugin-development, events


---

## 1 answers

### Answer by username_1 on 2015-03-26. Score: 5 | Accepted answer

Yes. It's not documented, but by instantiating the [Event class](http://buildwithcraft.com/classreference/etc/events/Event) (which is just a thin wrapper for [Yii's CEvent](http://www.yiiframework.com/doc/api/1.1/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>


---

