Documentation

ExecuteModuleEventEx

mixed
ExecuteModuleEventEx(
     $arEvent, 
     $arParams = array()
);

The function executes an event handler.

Function parameters

ParameterDescription Available from version
Event Structure of data, describing a single event handler. Array of descriptions for event handler returns the GetModuleEvents method.
Params List of parameters passed in the event handler. This list if defined by an event author and is individual to each event. Parameters can be passed both via link and the value. The parameters passed via the value can be modified inside the event handler. To pass the event handler via the value, a link for it must be added to the array.

Retrieving list of event handlers and calling them

foreach (GetModuleEvents("my_module", "MyEvent", true) as $arEvent)
{
    ExecuteModuleEventEx($arEvent, array(parameters));
}

Getting event handler lists with the option to cancel the method execution, inside which events are called.

foreach (GetModuleEvents("my_module", "MyEvent", true) as $arEvent)
{
    if (ExecuteModuleEventEx($arEvent, array(parameters))===false)
        return false;
}

Note

The ExecuteModuleEvent function is not supported from version 10.0.0 onwards for calling event handlers.

See Also

Examples of use

 ExecuteModuleEventEx($arEvent, array($ID, &$arFields))

In this case the event handler will receive two parameters - $ID and $arFields. It can change the value of the second parameters, because it is passed via link.



© «Bitrix24», 2001-2024
Up