Manual:$wgResourceModules/fr
From Linux Web Expert
<translate> ResourceLoader</translate>: $wgResourceModules | |
---|---|
Tableau de tous les modules supplémentaires définis pouvant être chargés ultérieurement pendant la sortie. |
|
<translate> Introduced in version:</translate> | 1.17.0 (r72349) |
<translate> Removed in version:</translate> | <translate> still in use</translate> |
<translate> Allowed values:</translate> | (tableau multidimensionnel) |
<translate> Default value:</translate> | [] |
<translate> Other settings:</translate> <translate> Alphabetical</translate> | <translate> By function</translate> |
Exemples
L'exemple ci-dessous applique ceci à partir d'une extension.
Ceci est à mettre dans votre fichier extension.json
.
"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"
]
}
},
Options
Voir MainConfigSchema::ResourceModules.
Charger un module
Voir ResourceLoader/Migration guide (developers)#Adding a module to the page :
Note
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.