3

I'm trying to bind to the onEditionChange event with something like this:

craft()->on('onEditionChange', function (Event $event) {
    craft()->womb->sendEvent($event);
});

However, i'm getting this error:

Undefined offset: 1

Seems it expects an dot in there. Is there another way to bind to this event?

2

Because that particular event is raised from AppBehavior (and therefore WebApp), it doesn't follow the same component.eventName syntax that the other Craft events use and you can't use craft->on() to register to listen to it.

You can register to listen to it through the traditional Yii method, though. This should work for you:

craft()->onEditionChange = function (Event $event) {
    craft()->womb->sendEvent($event);
};

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.