Hook Examples

This website contains links to software which is either no longer maintained or will be supported only until the end of 2019 (CKFinder 2). For the latest documentation about current CKSource projects, including software like CKEditor 4/CKEditor 5, CKFinder 3, Cloud Services, Letters, Accessibility Checker, please visit the new documentation website.

If you look for an information about very old versions of CKEditor, FCKeditor and CKFinder check also the CKEditor forum, which was closed in 2015. If not, please head to StackOverflow for support.

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);
This page was last edited on 26 May 2010, at 09:14.