Template:MW file/zh
| MediaWiki文件: {{{1}}} | |
|---|---|
| 位置: | / |
| 源代码: | master • 1.46.0 • 1.45.4 • 1.43.9 |
| 类: | 查找代码 • 查找帮助文档 |
| 此模板被大约6,500+个页面使用。 为避免大规模崩溃和不必要的服务器负载,对此模板的任何更改都应先在其/sandbox或/testcases子页面或您自己的用户子页面中进行测试。 然后经过测试的更改便可以通过单笔编辑添加到此页面。 请考虑在执行任何更改之前先于讨论页进行讨论。 |
Displays an informative box about a file in MediaWiki core, with links to its source code in master, stable, and legacy branches, and links to its classes and interfaces in the generated PHP documentation.
{{MW file|FILENAME|PATH
|class1=CLASS
|class2=CLASS
|class3=CLASS
|...
|interface1=INTERFACE
|interface2=INTERFACE
|interface3=INTERFACE
|NotInGit=REASON
}}
- FILENAME is the name of the file, including extension.
- If the file has been recently renamed, you can use the
stable=and thelegacy=parameters to provide the old name so links work; you'll need to update the template invocation as the release in which the file was renamed moves from master->stable->legacy.
- If the file has been recently renamed, you can use the
- PATH is the path to the file; do not include a leading slash, include the trailing slash. Leave it blank for files in the root directory.
- The
classarguments are all optional, and if supplied will link to the generated documentation. CLASS should be the class name, as used in the URL. E.g. "Parser" would generate a link to "classParser.html". The template allows up to six class parameters,class1-class6 - INTERFACE is similar. The template allows up to three interface parameters
- The
NotInGitargument is optional and should only be used if the file is not in Git for some reason (I think this only applies toLocalSettings.php). REASON is the reason that is displayed in the infobox. 注意NotInGit区分大小写!
手册广泛使用此模板。
示例
{{MW file|index.php|}}
| MediaWiki文件: index.php | |
|---|---|
| 位置: | |
| 源代码: | master • 1.46.0 • 1.45.4 • 1.43.9 |
| 类: | 查找代码 • 查找帮助文档 |
{{MW file|Article.php|includes/page/
|class1=MediaWiki\Page\Article
}}
| MediaWiki文件: Article.php | |
|---|---|
| 位置: | includes/page/ (1.46及以后为includes/Page/) |
| 源代码: | master • 1.46.0 • 1.45.4 • 1.43.9 |
| 类: | MediaWiki\Page\Article |
{{MW file|WikiPage.php|includes/page/
|class1=MediaWiki\Page\WikiPage
|interface1=MediaWiki\Page\Page
}}
| MediaWiki文件: WikiPage.php | |
|---|---|
| 位置: | includes/page/ (1.46及以后为includes/Page/) |
| 源代码: | master • 1.46.0 • 1.45.4 • 1.43.9 |
| 类: | MediaWiki\Page\WikiPage • MediaWiki\Page\Page |
{{MW file|LocalSettings.php|
|NotInGit=在安装时创建
}}
| MediaWiki文件: LocalSettings.php | |
|---|---|
| 位置: | |
| 源代码: | 未在Git中 (在安装时创建) |
| 类: | |
{{MW file|includes/Title/Title.php
|stable=includes/title/Title.php
|legacy=includes/title/Title.php
|lts=includes/Title.php
|class1=MediaWiki\Title\Title
}}
| MediaWiki文件: includes/Title/Title.php | |
|---|---|
| 源代码: | master • 1.46.0 • 1.45.4 • 1.43.9 |
| 类: | MediaWiki\Title\Title |
参阅
- {{Git file}} – a simple link to a file on gerrit (from mediawiki/core or otherwise)
- Category:MediaWiki code pages without class names – incompletely filled pages are automatically listed by this template
- Category:MediaWiki code pages without namespaces – File pages without a namespace declared are automatically added here. They should probably have a namespace.
Displays an informative box about a file in MediaWiki core, with links to its source code in master, stable, and legacy branches, and links to its classes and interfaces in the generated PHP documentation.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| File name | 1 | Name of the file, including extension. If the file has been recently renamed, you can use the stable= and the legacy= parameters to provide the old name so links work; you'll need to update the template invocation as the release in which the file was renamed moves from master → stable → legacy.
| String | required |
| File path | 2 | Path to the file; do not include a leading slash, include the trailing slash. Leave it blank for files in the root directory.
| String | required |
| Not in Git? | NotInGit | Whether the version is in Git version control (only rarely used for files like LocalSettings.php and DevelopmentSettings.php). Optional and should only be used if the file is not in Git for some reason. Reason= is the reason that is displayed in the infobox. Note that NotInGit is CASE-SENSITIVE.
| String | optional |
| Stable MediaWiki version | stable | no description | Unknown | optional |
| Legacy MediaWiki version | legacy | no description | Unknown | optional |
| LTS MediaWiki Version | lts | Long-Term Support version for MediaWiki | Unknown | optional |
| Class 1 | class1 | Class arguments are all optional, and if supplied will link to the generated documentation. Class should be the class name, as used in the URL. The template allows up to six class parameters
| String | suggested |
| Class 2 | class2 | no description | Unknown | optional |
| Class 3 | class3 | no description | Unknown | optional |
| Class 4 | class4 | no description | Unknown | optional |
| Class 5 | class5 | no description | Unknown | optional |
| Class 6 | class6 | no description | Unknown | optional |
| Interface 1 | interface1 | Similar to Class. The template allows up to three interface parameters. | Unknown | suggested |
| Interface 2 | interface2 | no description | Unknown | optional |
| Interface 3 | interface3 | no description | Unknown | optional |
| Example | example | no description | Unknown | optional |
| nodisplaytitle | nodisplaytitle | no description | Unknown | optional |