(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: …') |
m (moved CKFinder 2.x/Developers Guide/PHP/Plugins/Writing PHP/Hooks Examples to CKFinder 2.x/Developers Guide/PHP/Plugins/Writing PHP/Hook Examples) |
(No difference)
|
Latest revision as of 10:14, 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);