Manual:Hooks/BaseTemplateToolbox

From MediaWiki.org
Jump to: navigation, search

Other languages:
English • ‎日本語 • ‎中文
BaseTemplateToolbox
Available from version 1.18.0 (r77893)
Called by BaseTemplate when building the toolbox array and returning it for the skin to output.
Define function:
public static function onBaseTemplateToolbox( BaseTemplate $baseTemplate, array &$toolbox ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"BaseTemplateToolbox": [
			"MyExtensionHooks::onBaseTemplateToolbox"
		]
	}
}

For MediaWiki ≤1.25:

$wgHooks['BaseTemplateToolbox'][] = 'MyExtensionHooks::onBaseTemplateToolbox';
Called from: File(s): SkinTemplate.php

For more information about attaching hooks, see Manual:Hooks.
For examples of extensions using this hook, see Category:BaseTemplateToolbox extensions.

Details[edit]

You can add items to the toolbox while still letting the skin make final decisions on skin-specific markup conventions using this hook.