Module instance is created only if you use this particular module, same applies to init
method. So, when you access different module event is not attached, even more, other modules are not aware of this, because they have no information that anything global should be registered.
But you use user
component - which is guaranteed to run. You could register event onUserRegister (in user
component) to call some method, prefably not from module, but from something lighter, maybe some Points
model? Of course this breaks modularity, because if you remove PointsModule
it will break user
component.
Maybe you could attach it in config i'm using following config for application component:
'onBeginRequest' => function()
{
YII_DEBUG? : ob_start("ob_gzhandler");
}
Something like:
'user' => [
'onUserRegister' => function()
{
// Handle event here
}
]
Side note: Cross module or more generally cross component interaction migth be tricky. I'm developing extension for this purpose, idea is to aggregate events from whole application and fire them when needed.