手册:钩子/BaseTemplateToolbox
Appearance
在1.35.0版本起弃用后,此功能已在版本1.37.0中,从MediaWiki核心代码中移除。 请参见SidebarBeforeOutput以获取使用此功能的替代方式。 |
BaseTemplateToolbox | |
---|---|
自version 1.18.0 (r77893, CodeReview archive)版可用 在version 1.37.0 (Gerrit change 708593)版被移除 Called by BaseTemplate when building the toolbox array and returning it for the skin to output. | |
定义函数: | public static function onBaseTemplateToolbox( BaseTemplate $baseTemplate, array &$toolbox ) { ... }
|
附加钩子: | 在extension.json中:
{
"Hooks": {
"BaseTemplateToolbox": "MediaWiki\\Extension\\MyExtension\\Hooks::onBaseTemplateToolbox"
}
}
|
调用自: | 文件: SkinTemplate.php |
介面: | BaseTemplateToolboxHook.php |
更多有关附加钩子的信息,请参见Manual:Hooks 。
有关使用此钩子的扩展示例,请参见Category:BaseTemplateToolbox extensions/zh。
This hook was deprecated in MW 1.35, and removed in MW 1.37. In its place, you can use either of the following hooks:
- SkinBuildSidebar - respects caching; only called when a page is recreated
- SidebarBeforeOutput - ignores caching; called on every page load
详情
You can add items to the toolbox while still letting the skin make final decisions on skin-specific markup conventions using this hook.
- BaseTemplate $baseTemplate - The BaseTemplate base skin template.
- array &$toolbox - An array of toolbox items, see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array.