Template:MW file
MediaWiki file: {{{1}}} | |
---|---|
Location: | / |
Source code: | master • 1.41.1 • 1.40.3 • 1.39.7 |
Classes: | Find code • Find documentation |
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
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. 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
NotInGit
argument 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. Note thatNotInGit
is case sensitive!
The Manual uses this template extensively.
Examples
{{MW file|index.php|}}
MediaWiki file: index.php | |
---|---|
Location: | |
Source code: | master • 1.41.1 • 1.40.3 • 1.39.7 |
Classes: | Find code • Find documentation |
{{MW file|Article.php|includes/page/ |class1=Article }}
MediaWiki file: Article.php | |
---|---|
Location: | includes/page/ |
Source code: | master • 1.41.1 • 1.40.3 • 1.39.7 |
Classes: | Article |
{{MW file|WikiPage.php|includes/page/ |class1=WikiPage |interface1=Page }}
MediaWiki file: WikiPage.php | |
---|---|
Location: | includes/page/ |
Source code: | master • 1.41.1 • 1.40.3 • 1.39.7 |
Classes: | WikiPage • Page |
{{MW file|LocalSettings.php| |NotInGit=created during installation }}
MediaWiki file: LocalSettings.php | |
---|---|
Location: | |
Source code: | not in Git (created during installation) |
Classes: |
See also
- {{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
<templatedata> { "params": { "1": { "label": "File name", "required": true }, "2": { "label": "File path", "required": true }, "nodisplaytitle": {}, "NotInGit": { "label": "Not in Git?", "description": "Whether the version is in Git version control (only rarely used for files like LocalSettings.php and DevelopmentSettings.php)", "type": "boolean" }, "stable": { "label": "Stable MediaWiki version" }, "legacy": { "label": "Legacy MediaWiki version" }, "lts": { "label": "LTS MediaWiki Version", "description": "Long-Term Support version for MediaWiki" }, "class1": { "label": "Class 1", "suggested": true }, "class2": { "label": "Class 2" }, "class3": { "label": "Class 3" }, "class4": { "label": "Class 4" }, "class5": { "label": "Class 5" }, "class6": { "label": "Class 6" }, "interface1": { "label": "Interface 1", "suggested": true }, "interface2": { "label": "Interface 2" }, "interface3": { "label": "Interface 3" }, "example": { "label": "Example" } }, "paramOrder": [ "nodisplaytitle", "1", "2", "NotInGit", "stable", "legacy", "lts", "class1", "class2", "class3", "class4", "class5", "class6", "interface1", "interface2", "interface3", "example" ], "format": "block", "description": "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. " } </templatedata>
Maintenance: noslash