addEventListener
Last edited by JP DeVries on Aug 9, 2013.
API:addEventListener
API Quick reference
Variable name: | addEventListener |
Modx versions: | 0.9.x + Evolution |
Input parameters: | $evtName, $pluginName
|
Return if successful: | Array of events and plugins
|
Return type: | array |
Return on failure: | |
Object parent: | DocumentParser |
Description / Usage
string addEventListener($evtName, $pluginName);
Add an event listener to a plugin - only for use within the current execution cycle.
Examples
Related
Notes
Function Source
Function Source
function addEventListener($evtName, $pluginName) { if (!$evtName || !$pluginName) return false; if (!array_key_exists($evtName,$this->pluginEvent)) $this->pluginEvent[$evtName] = array(); return array_push($this->pluginEvent[$evtName], $pluginName); // return array count }
Suggest an edit to this page on GitHub (Requires GitHub account. Opens a new window/tab).