模板:扩展钩子

From MediaWiki.org
Jump to navigation Jump to search
This page is a translated version of the page Template:ExtensionHook and the translation is 43% complete.

Outdated translations are marked like this.
Other languages:
English • ‎dansk • ‎polski • ‎中文 • ‎日本語
Template documentation

复制粘贴模板

MyHook
自??? 版可用

定义函数:
public static function onMyHook( $x, $y ) { ... }
附加钩子:
$wgHooks['MyHook'][] = 'MyExtensionHooks::onMyHook';
调用自:文件:

更多有关附加钩子的信息,请参见手册:钩子
有关使用此钩子的其他扩展示例,参见Category:MyHook extensions/zh

{{ExtensionHook
|name = MyHook
|version =
|gerrit =
|removed =
|summary =
|args = $x, $y
|source =
|sourcefunction =
|sourceclass =
|newvarname =
|newvarlink =
}}

用法注释

name
钩子名称。 This is usually the same name as the sub-page.
version
The version of MediaWiki this hook was first introduced in.
rev
SVN revision in which this hook was first introduced. If this parameter is given, it'll link to the appropriate CodeReview page (e.g. Special:Code/MediaWiki/1).
gerrit
Gerrit change number in which this hook was first introduced. If this parameter is given, it'll link to the appropriate Gerrit changeset page (e.g. Gerrit change 1)
removed
If the hook has been removed, the version of MediaWiki that it was removed in.
deprecated
If the hook has been deprecated (but not removed), the version of MediaWiki that it was deprecated in.
summary
A short description of the hook's purpose.
More detailed descriptions are desirable, and should be added to the main page content.
If you update the short description, please also update the two tables on 手册:钩子 .
args
The arguments, as used at the top of the function.
source
Location (file name) which calls this hook in the code. Further locations can be added via source2...source10.
sourcefunction
Name of the function which calls this hook. Another can be added via sourcefunction.
sourceclass
Name of the class which calls this hook.
templatemode
Set to nocats if hook documentation should not appear in standard MediaWiki Categories.
By default, using this template places the documentation page into categories:
  • MediaWiki钩子
  • MediaWiki中添加的钩子...
There are times when it is undesirable to automatically categorize the hook documentation. Examples would include when documenting a hook in an extension, or when documenting the template itself.