Jump to content
MediaWiki

Podręcznik:$wgResourceModules

From mediawiki.org
This page is a translated version of the page Manual:$wgResourceModules and the translation is 21% complete.
Outdated translations are marked like this.
ResourceLoader: $wgResourceModules
Array of all extra defined modules that can later be loaded during the output.
Wprowadzono w wersji:1.17.0 (r72349)
Usunięto w wersji:nadal w użyciu
Dozwolone wartości:(multi-dimensional array)
Domyślna wartość:[]
Inne ustawienia: Alfabetycznie | Według funkcji

Przykłady

[edit ]

Below is an example of how to use this in an extension. You would put this in your extension.json file.

"ResourceModules":{
"ext.MyExtension":{
"localBasePath":"modules/ext.MyExtension",
"remoteExtPath":"MyExtension/modules/ext.MyExtension",
"styles":[
"foo.css",
"bar.css"
],
"packageFiles":[
"index.js",
"foo.js"
],
"messages":[
"myextension-foo-label"
],
"dependencies":[
"jquery.cookie",
"mediawiki.util"
]
}
},

Szczegóły

[edit ]

Loading module

[edit ]

Note

[edit ]

If you require a list of all registered modules, it is not recommended to call $GLOBALS[ 'wgResourceModules' ] from a skin or extension. The list may not be complete at the time of the request. See ResourceLoader::getModuleNames() instead.

Zobacz też

[edit ]

AltStyle によって変換されたページ (->オリジナル) /