Jump to content

Own CodonEvents


Karamellwuerfel

Recommended Posts

Hello,

 

is it possible to create own CodonEvents and then add Listeners to this created event? For example the existing event "bid_added". I want to create a new one "updated_flight".

Is there anywhere a Codon documentation? I can't find one.

 

I tried to just Dispatch an event and listen to it but this doesn't work for me...

CodonEvent::Dispatch('updated_flight', 'ACARSData', $flight_info);

 

public function __construct()
{
    CodonEvent::addListener('Test', array('bid_added', 'updated_flight'));
}

public function EventListener($eventinfo)
{
    if($eventinfo[0] == 'bid_added')
    {
        //something
    }
    if($eventinfo[0] == 'updated_flight')
    {
        TestData::test($eventinfo[2]);
    }
}

Thanks! :)

Edited by Karamellwuerfel
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...