Manual:$wgResourceModules
Appearance
| ResourceLoader: $wgResourceModules | |
|---|---|
| Array of all extra-defined modules that can later be loaded during the output. |
|
| 導入されたバージョン: | 1.17.0 (r72349) |
| 除去されたバージョン: | 使用中 |
| 許容される値: | (多次元配列) |
| 既定値: | [] |
| その他の設定: アルファベット順 | 機能順 | |
例
以下は、拡張機能でこれを使用する方法の例です。
これを 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"
]
}
},
オプション
MainConfigSchema::ResourceModules を参照してください。
モジュールの読み込み
ResourceLoader/Developing with ResourceLoader#Loading modules を参照してください。
注記
登録されているすべてのモジュールのリストが必要な場合、外装または拡張機能から $GLOBALS[ 'wgResourceModules' ] を呼び出すことは推奨されません。
リクエストの時点では完全でない可能性があります。
代わりに ResourceLoader::getModuleNames() を参照してください。
関連項目
- ResourceLoader
$wgResourceModules- あとでページに読み込めるモジュールを登録する$wgResourceModuleSkinStyles- 既存の ResourceLoader モジュールに追加する、外装付帯スタイルシートを登録する$wgResourceLoaderDebug- MediaWiki の既定のデバッグ モードを構成する- Internal configuration settings:
$wgExtensionAssetsPath,$wgResourceLoaderMaxage ResourceLoaderRegisterModuleshook- Developing with ResourceLoader – Learn how to use ResourceLoader in MediaWiki