跳转到内容

模板:Class doclink/doc

来自天灾之下:危险连接资料站
wiki>DAlangi (WMF)2025年12月15日 (一) 21:16的版本 (Wrap template examples in order to prevent table width from overflowing.)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)

Template:Class doclink

Given a class name implemented by mediawiki/core, this renders a link to automatically-generated documentation for the class at https://doc.wikimedia.org/mediawiki-core/master/php/

Code Preview
{{class doclink|MediaWiki\Output\OutputPage}}
MediaWiki\Output\OutputPage
{{class doclink|MediaWiki\Request\WebRequest|WebRequest}}
WebRequest
{{class doclink|class=MediaWiki\Context\RequestContext|RequestContext}}
MediaWiki\Context\RequestContext
{{class doclink|MediaWiki\Config\Config|Config|type=interface}}
Config
{{class doclink
  |Wikimedia\Rdbms\Database|Wikimedia\Rdbms\Database::select
  |anchor=a3b03dd27f434aabfc8d2d639d1e5fa9a
}}
Wikimedia\Rdbms\Database::select
{{class doclink
  |class=Wikimedia\Rdbms\Database
  |text=Wikimedia\Rdbms\Database::select
  |anchor=a3b03dd27f434aabfc8d2d639d1e5fa9a
}}
Wikimedia\Rdbms\Database::select

Parameters

Renders a link to automatically-generated documentation for a class or method at https://doc.wikimedia.org/mediawiki-core/master/php/

模板参数

此模板首选参数不换行的行内格式。

参数描述类型状态
class name1 class

Fully qualified class name.

示例值
Wikimedia\Rdbms\Database
字符串必需
text2 text

Link text.

示例值
Database
字符串可选
anchoranchor

URL anchor. Used for linking to a specific property or method of the class.

示例值
a3b03dd27f434aabfc8d2d639d1e5fa9a
字符串可选
typetype

Type of the entity: class or interface. (With the current documentation structure, it's not possible to link traits.) Required if it's not a class.

默认值
interface
字符串可选
Project / extension nameproject

Project name, from https://doc.wikimedia.org/index/ . For extensions, this is just the name of the extension. For most other things, it is the repository name, with dashes instead of slashes.

示例值
mediawiki-libs-RemexHtml
字符串可选
branchbranch

Git branch (if not master).

示例值
main
字符串可选

See also

  • {{Class }} links to the implicit Manual:ClassName.php wiki page
  • {{MW file }} renders a table for a PHP file in core, including doc links for the classes implemented by it
  • {{Method doclink }} to link to a particular method
  • {{File doclink }}
  • {{Js doclink }} for Javascript API links