(Created page with 'An event handler might be a function, a method or even just an object. <source lang="php"> // [Function, no data] $config['Hooks']['EventName'][] = 'someFunction'; // result: …') |
(No difference)
|
Revision as of 09:13, 26 May 2010
An event handler might be a function, a method or even just an object.
// [Function, no data] $config['Hooks']['EventName'][] = 'someFunction'; // result: someFunction($param1, $param2); // [Function with data] $config['Hooks']['EventName'][] = array('someFunction', $someData); // result: someFunction($someData, $param1, $param2); // [Object only] $config['Hooks']['EventName'][] = $object; // result: $object->onEventName($param1, $param2); // [Object with method] $config['Hooks']['EventName'][] = array($object, 'someMethod'); // result: $object->someMethod($param1, $param2); // [Object with method and data] $config['Hooks']['EventName'][] = array($object, 'someMethod', $someData); // result: $object->someMethod($someData, $param1, $param2);