Jump to content

CodonEvent:Dispatch Questions [SOLVED]


Kyle

Recommended Posts

  • Moderators

Hey,

If I add a CodonEvent:Dispatch into the ApprovePilot area, will it affect anything to cause errors?

Here's how I have it done...

CodonEvent::Dispatch('pilot_approved', 'PilotAdmin', $_POST);

If I added this, and then add a module listener. Would the CodoEvent:Dispatch work in the 'pilot_approved' area?

Any help would be great! Thanks!

Link to comment
Share on other sites

  • Administrators

There is already an event on the admin side when a pilot is approved in PilotAdmin.php on line 632;

CodonEvent::Dispatch('pilot_approved', 'PilotAdmin', $pilot);

'

You just need to build the hook (listener) in your new module that is looking for the event, something like this in your module;


public function __construct() {
           CodonEvent::addListener('MyNewModuleName', array('pilot_approved'));
       }

public function EventListener($eventinfo) {
           if($eventinfo[0] == 'pilot_approved') {
               //do stuff
           }
       }

Just remember that a module on the pilot side of the system will not catch an event from the admin side, and vice-versa.

  • Like 1
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...