I’m using WebloginPE. I want to do some additional work with the registration info when a user is created. But this can relate to the API as a whole.
How do I fire my function during: ’$modx->invokeEvent(’OnBeforeWebSaveUser’, $parameters);’. Can I use this function via my snippet or am I required to use a plugin?
Chuck
-
MODX Staff
- 10,725 Posts
Plugins and events go hand-in-hand. You use a plugin to execute code when an event is invoked; if you want to execute a snippet, you’d have to use a plugin to execute the snippet via the API, i.e. $modx->runSnippet(). So, basically, without a plugin registered to an event, there can be no event handling.
ok. So since Scotty calls invokeEvent(’OnBeforeWebSaveUser’), I can use the plugin/event handler to run my code or execute my snippet? Right? That sounds easy enough.