Jump to content

Template:MW file

From mediawiki.org
This page is a translated version of the page Template:MW file and the translation is 88% complete.


Template documentation

Mostra un quadre informatiu sobre un fitxer del nucli de MediaWiki, amb enllaços cap al codi font a les branques master, stable i legacy, i enllaços cap a les classes i interfícies a la documentació PHP generada.

{{MW file|FILENAME|PATH
|class1=CLASS
|class2=CLASS
|class3=CLASS
|...
|interface1=INTERFACE
|interface2=INTERFACE
|interface3=INTERFACE
|NotInGit=REASON
}}
  • FILENAME és el nom del fitxer, inclosa l'extensió.
    • Si el fitxer s'ha reanomenat recentment, podeu emprar els paràmetres stable= i legacy= per proporcionar el nom antic perquè els enllaços funcionin; us caldrà actualitzar la invocació de plantilla a mesura que la versió en què es va reanomenar el fitxer vagi de master a stable i d'aquí a legacy.
  • PATH és el camí del fitxer; no hi inclogueu una barra al davant, però sí al darrere. Deixeu-ho en blanc per a fitxers del directori arrel.
  • Tots els arguments de class són opcionals, i si es subministren enllaçaran amb la documentació generada. CLASS ha de ser el nom de la classe, tal com s'utilitza a l'URL. Per exemple, "Parser" generaria un enllaç cap a "classParser.html". La plantilla permet fins a sis paràmetres de classe, class1-class6
  • INTERFACE és similar. La plantilla permet fins a tres paràmetres d'interfície
  • L'argument NotInGit és opcional i només hauria d'emprar-se si el fitxer no és a Git per qualsevol motiu (crec que això només afecta a LocalSettings.php). REASON és la raó que es mostra a la infotaula. Penseu que NotInGit és sensible a caixa (majúscules/minúscules)!

El Manual utilitza aquesta plantilla abastament.

Exemples

{{MW file|index.php|}}


{{MW file|Article.php|includes/page/
|class1=MediaWiki\Page\Article
}}

{{MW file|WikiPage.php|includes/page/
|class1=MediaWiki\Page\WikiPage
|interface1=MediaWiki\Page\Page
}}

{{MW file|LocalSettings.php|
|NotInGit=creat durant la instal·lació
}}


{{MW file|includes/Title/Title.php
|stable=includes/title/Title.php
|legacy=includes/title/Title.php
|lts=includes/Title.php
|class1=MediaWiki\Title\Title
}}

Vegeu també

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.

Template parameters[Edit template data]

This template prefers block formatting of parameters.

ParameterDescriptionTypeStatus
File name1

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.

Example
LocalSettings.php
Stringrequired
File path2

Path to the file; do not include a leading slash, include the trailing slash. Leave it blank for files in the root directory.

Example
includes/libs/
Stringrequired
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.

Example
created during installation
Stringoptional
Stable MediaWiki versionstable

no description

Unknownoptional
Legacy MediaWiki versionlegacy

no description

Unknownoptional
LTS MediaWiki Versionlts

Long-Term Support version for MediaWiki

Unknownoptional
Class 1class1

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

Example
"Parser" would generate a link to "classParser.html"
Stringsuggested
Class 2class2

no description

Unknownoptional
Class 3class3

no description

Unknownoptional
Class 4class4

no description

Unknownoptional
Class 5class5

no description

Unknownoptional
Class 6class6

no description

Unknownoptional
Interface 1interface1

Similar to Class. The template allows up to three interface parameters.

Unknownsuggested
Interface 2interface2

no description

Unknownoptional
Interface 3interface3

no description

Unknownoptional
Exampleexample

no description

Unknownoptional
nodisplaytitlenodisplaytitle

no description

Unknownoptional