This page is a translated version of the page Template:ExtensionHook and the translation is 49% complete.
模板文件

复制粘贴模板

MyHook
自??? 版可用

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

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

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

用法注释

name
钩子名称。 这通常与子页面名称相同。
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 will link to the appropriate CodeReview page (e.g. r115794).
gerrit
Gerrit change number in which this hook was first introduced. If this parameter is given, it will link to the appropriate Gerrit changeset page (e.g., Gerrit change 5)
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 Manual:Hooks .
args
The arguments, as used at the top of the function.
extension
Extension name where hook is called; for when the source is not in the MediaWiki core code repository.
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 sourcefunction2.
sourceclass
Name of the class which calls this hook.
newvarname
当设置好removed或者deprecated时,请使用{{Removed}}或者{{Deprecated}}
newvarlink
当设置好removed或者deprecated时,请使用{{Removed}}或者{{Deprecated}}
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 categorise the hook documentation. Examples would include when documenting a hook in an extension, or when documenting the template itself.
nocatdesc
If a hook is removed completely from MediaWiki version by setting yes, it will not show up the category description.

Template data

A card which describes the information of a hook registered by an extension.

Template parameters[Edit template data]

This template prefers block formatting of parameters.

ParameterDescriptionTypeStatus
Template modetemplatemode

no description

Stringoptional
Namename

The name of the hook. This is usually the same name as the sub-page.

Stringrequired
SVN revision introducedrev

SVN revision in which this hook was first introduced. If this parameter is given, it will link to the appropriate CodeReview page.

Stringoptional
Gerrit changeset introducedgerrit

Gerrit change number in which this hook was first introduced. If this parameter is given, it will link to the appropriate Gerrit changeset page.

Numbersuggested
Version introducedversion

The version of MediaWiki this hook was first introduced in.

Stringsuggested
Version deprecateddeprecated

If the hook has been deprecated, the version of MediaWiki that it was deprecated in.

Stringoptional
Gerrit ID of deprecationgerritdeprecated

no description

Numberoptional
Version removedremoved

If the hook has been removed, the version of MediaWiki that it was removed in.

Stringoptional
Gerrit ID of removalgerritremoved

no description

Numberoptional
Replacement namenewvarname

If the hook is either deprecated or removed, name the feature that replaces this hook, if there is any replacement.

Stringoptional
Replacement linknewvarlink

If the hook is either deprecated or removed, link to the feature that replaces this hook, if there is any replacement.

Page nameoptional
Summarysummary

A short description of the hook's purpose. More detailed descriptions are desirable, and should be added to the main page content.

Stringsuggested
Argumentsargs

The arguments that are defined by the hook signature.

Stringrequired
Extension nameextension

Extension name where the hook is called; for when the source is not in the MediaWiki core code repository.

Page namerequired
Source 1source

Location (file name) which calls this hook in the code.

Stringsuggested
Source 2source2

Location (file name) which calls this hook in the code, if another source exists

Stringoptional
Source 3source3

Location (file name) which calls this hook in the code, if another source exists

Stringoptional
Source 4source4

Location (file name) which calls this hook in the code, if another source exists

Stringoptional
Source 5source5

Location (file name) which calls this hook in the code, if another source exists

Stringoptional
Source 6source6

Location (file name) which calls this hook in the code, if another source exists

Stringoptional
Source 7source7

Location (file name) which calls this hook in the code, if another source exists

Stringoptional
Source 8source8

Location (file name) which calls this hook in the code, if another source exists

Stringoptional
Source 9source9

Location (file name) which calls this hook in the code, if another source exists

Stringoptional
Source 10source10

Location (file name) which calls this hook in the code, if another source exists

Stringoptional
Source classsourceclass

The fully qualified class name (FQCN) which calls this hook.

Stringsuggested
Source functionsourcefunction

Name of the function which calls this hook

Stringsuggested
Source function 2sourcefunction2

Name of the function which calls this hook, if another functions call this hook

Stringoptional
No category descriptionnocatdesc

Allows to hide the category hook description if the hook was removed completely from MediaWiki version.

Stringoptional

See also