Handbuch:$wgHooks

From MediaWiki.org
Jump to navigation Jump to search
This page is a translated version of the page Manual:$wgHooks and the translation is 54% complete.

Other languages:
Deutsch • ‎English • ‎Nederlands • ‎español • ‎français • ‎magyar • ‎polski • ‎português • ‎português do Brasil • ‎العربية • ‎ไทย • ‎中文 • ‎日本語
Erweiterungen: $wgHooks
Global list of hooks.
Eingeführt in Version:1.4.0 (r6405)
Entfernt in Version:weiterhin vorhanden
Erlaubte Werte:Siehe Details
Standardwert:[]
Andere Einstellungen: Alphabetisch | Nach Funktion

Details

Global list of hooks. It is an array of arrays: it specifies for every event an array of functions to be called.

Add a hook by doing:

$wgHooks['event_name'][] = 'function';

oder:

$wgHooks['event_name'][] = array( 'function', $data );

oder:

$wgHooks['event_name'][] = array( $object, 'method' );

oder:

$wgHooks['event_name'][] = $object;

In the last case, the callback is expected to be a method in $object of the same name as the event preceded by "on", e.g. "onUnknownAction"

Hooks are called when events happen, where a hook is a PHP function, and an event is an abstract concept.

Siehe auch