Шаблон:ExtensionHook

From mediawiki.org
This page is a translated version of the page Template:ExtensionHook and the translation is 97% complete.
Документация шаблона

Скопируйте и вставьте шаблон

MyHook
Доступен с версии ???

Определяет функцию:
public static function onMyHook( $x, $y ) { ... }
Присоединяет хук:
$wgHooks['MyHook'][] = 'MyExtensionHooks::onMyHook';
Вызывается из:Файл(ы)

Для получения дополнительной информации о присоединении хуков, смотрите Руководство:Хуки .
Для примеров других расширений, использующих этот хук, смотрите Category:MyHook extensions/ru.

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

Примечания по использованию

name
Название хука. Обычно это то же имя, что и подстраница.
version
Версия MediaWiki, в которой этот хук был впервые представлен.
rev
Версия SVN, в которой этот хук был впервые представлен. Если указан этот параметр, он будет ссылаться на соответствующую страницу CodeReview (например, r115794).
gerrit
Номер изменения Gerrit, в котором этот хук был впервые представлен. Если указан этот параметр, он будет ссылаться на соответствующую страницу изменений Gerrit (например, Gerrit change 5)
removed
Если хук был удалён, версия MediaWiki, в которой он был удален.
deprecated
Если хук устарел (но не удалён), версия MediaWiki, в которой он устарел.
summary
Краткое описание цели хука.
Более подробные описания желательны, и должны быть добавлены к содержанию главной страницы.
Если вы обновите краткое описание, пожалуйста, обновите две таблицы на Руководство:Хуки .
args
Аргументы, используемые в верхней части функции.
extension
Extension name where hook is called; for when the source is not in the MediaWiki core code repository.
source
Местоположение (имя файла), которое вызывает этот хук в коде. Другие местоположения могут быть добавлены через source2...source10.
sourcefunction
Имя функции, которую вызывает этот хук. Еще можно добавить через sourcefunction2.
sourceclass
Имя класса, который вызывает этот хук.
newvarname
Используйте {{Removed}} или {{Deprecated}}, когда установлены removed или deprecated.
newvarlink
Используйте {{Removed}} или {{Deprecated}}, когда установлены removed или deprecated.
templatemode
Установите значение nocats, если документация о хуке не должна появляться в стандартных категориях MediaWiki.
По умолчанию использование этого шаблона размещает страницу документации в категориях:
  • MediaWiki хуки
  • Хуки добавленные в MediaWiki...
В некоторых случаях нежелательно автоматически классифицировать документацию о хуках. Примерами могут служить документирование хука в расширении или документирование самого шаблона.
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

Смотрите также