Answers.Body: <p>Because that particular event is raised from <a href="http://buildwithcraft.com/classreference/etc/behaviors/AppBehavior" rel="nofollow">AppBehavior</a> (and therefore <a href="http://buildwithcraft.com/classreference/etc/web/WebApp" rel="nofollow">WebApp</a>), it doesn't follow the same <code>component.eventName</code> <a href="http://buildwithcraft.com/docs/plugins/events-reference" rel="nofollow">syntax</a> that the other Craft events use and you can't use <a href="http://buildwithcraft.com/classreference/etc/web/WebApp#on-detail" rel="nofollow">craft->on()</a> to register to listen to it.</p>
  
  <p>You can register to listen to it through the traditional <a href="http://www.yiiframework.com/wiki/327/events-explained" rel="nofollow">Yii method</a>, though.  This should work for you:</p>
  
  <pre><code>craft()-&gt;onEditionChange = function (Event $event) {
      craft()-&gt;womb-&gt;sendEvent($event);
  };
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-08-27T22:04:40.463Z
Answers.LastActivityDate: 2015-08-27T22:04:40.463Z
Answers.UserDisplayName: Brad Bell
Body: <p>I'm trying to bind to the onEditionChange event with something like this:</p>
  
  <pre><code>craft()-&gt;on('onEditionChange', function (Event $event) {
      craft()-&gt;womb-&gt;sendEvent($event);
  });
  </code></pre>
  
  <p>However, i'm getting this error:</p>
  
  <pre><code>Undefined offset: 1
  </code></pre>
  
  <p>Seems it expects an dot in there. Is there another way to bind to this event?</p>
  
Tags: <events>
Title: Getting PHP error when trying to bind to onEditionChange event
ThreadText: # Getting PHP error when trying to bind to onEditionChange event
  
  (Asked by: username_0 on 2015-08-27)
  
  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?
  
  **Tags:** events
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-08-27. Score: 2 | Accepted answer
  
  Because that particular event is raised from [AppBehavior](http://buildwithcraft.com/classreference/etc/behaviors/AppBehavior) (and therefore [WebApp](http://buildwithcraft.com/classreference/etc/web/WebApp)), it doesn't follow the same `component.eventName` [syntax](http://buildwithcraft.com/docs/plugins/events-reference) that the other Craft events use and you can't use [craft->on()](http://buildwithcraft.com/classreference/etc/web/WebApp#on-detail) to register to listen to it.
  
  You can register to listen to it through the traditional [Yii method](http://www.yiiframework.com/wiki/327/events-explained), though. This should work for you:
  
  ```
  craft()->onEditionChange = function (Event $event) {
      craft()->womb->sendEvent($event);
  };
  
  ```
  
  
  ---
  
  