MediaWiki
1.32.5
|
Bootstrap a ResourceLoader client on an HTML page. More...
Public Member Functions | |
__construct (ResourceLoaderContext $context, array $options=[]) | |
getBodyHtml () | |
getDocumentAttributes () | |
getHeadHtml () | |
The order of elements in the head is as follows: More... | |
setConfig (array $vars) | |
Set mw.config variables. More... | |
setExemptStates (array $states) | |
Set state of special modules that are handled by the caller manually. More... | |
setModules (array $modules) | |
Ensure one or more modules are loaded. More... | |
setModuleScripts (array $modules) | |
Ensure the scripts of one or more modules are loaded. More... | |
setModuleStyles (array $modules) | |
Ensure the styles of one or more modules are loaded. More... | |
Static Public Member Functions | |
static | makeLoad (ResourceLoaderContext $mainContext, array $modules, $only, array $extraQuery=[], $nonce=null) |
Explicily load or embed modules on a page. More... | |
Private Member Functions | |
getContext ( $group, $type) | |
getData () | |
getLoad ( $modules, $only, $nonce, array $extraQuery=[]) | |
Static Private Member Functions | |
static | makeContext (ResourceLoaderContext $mainContext, $group, $type, array $extraQuery=[]) |
Private Attributes | |
array | $config = [] |
ResourceLoaderContext | $context |
array | $data |
array | $exemptStates = [] |
array | $modules = [] |
array | $moduleScripts = [] |
array | $moduleStyles = [] |
array | $options |
ResourceLoader | $resourceLoader |
Bootstrap a ResourceLoader client on an HTML page.
Definition at line 29 of file ResourceLoaderClientHtml.php.
ResourceLoaderClientHtml::__construct | ( | ResourceLoaderContext | $context, |
array | $options = [] |
||
) |
ResourceLoaderContext | $context | |
array | $options | [optional] Array of options
|
Definition at line 65 of file ResourceLoaderClientHtml.php.
References $context, ResourceLoaderContext\getResourceLoader(), and options().
ResourceLoaderClientHtml::getBodyHtml | ( | ) |
Definition at line 363 of file ResourceLoaderClientHtml.php.
|
private |
Definition at line 378 of file ResourceLoaderClientHtml.php.
References $type, and makeContext().
Referenced by getData().
|
private |
Definition at line 128 of file ResourceLoaderClientHtml.php.
References $context, $data, $name, $resourceLoader, as, data, getContext(), ResourceLoaderModule\LOAD_STYLES, ResourceLoaderModule\TYPE_COMBINED, ResourceLoaderModule\TYPE_SCRIPTS, and ResourceLoaderModule\TYPE_STYLES.
Referenced by getBodyHtml(), and getHeadHtml().
ResourceLoaderClientHtml::getDocumentAttributes | ( | ) |
Definition at line 246 of file ResourceLoaderClientHtml.php.
ResourceLoaderClientHtml::getHeadHtml | ( | ) |
The order of elements in the head is as follows:
Reasons:
Definition at line 264 of file ResourceLoaderClientHtml.php.
References $data, as, getData(), getLoad(), Html\inlineScript(), options(), string, ResourceLoaderModule\TYPE_COMBINED, ResourceLoaderModule\TYPE_SCRIPTS, and ResourceLoaderModule\TYPE_STYLES.
|
private |
Definition at line 382 of file ResourceLoaderClientHtml.php.
References $modules, array(), and makeLoad().
Referenced by getHeadHtml().
|
staticprivate |
Definition at line 386 of file ResourceLoaderClientHtml.php.
References $context, $req, $ret, $type, ResourceLoaderContext\getContentOverrideCallback(), ResourceLoaderContext\getRequest(), ResourceLoaderContext\getResourceLoader(), and ResourceLoaderModule\TYPE_COMBINED.
Referenced by getContext(), and makeLoad().
|
static |
Explicily load or embed modules on a page.
ResourceLoaderContext | $mainContext | |
array | $modules | One or more module names |
string | $only | ResourceLoaderModule TYPE_ class constant |
array | $extraQuery | [optional] Array with extra query parameters for the request |
string | null | $nonce | [optional] Content-Security-Policy nonce (from OutputPage::getCSPNonce) |
Definition at line 415 of file ResourceLoaderClientHtml.php.
References $context, $modules, $name, $source, as, captcha-old\count, Html\element(), Xml\encodeJsCall(), ResourceLoaderContext\getDebug(), ResourceLoaderContext\getRaw(), ResourceLoaderContext\getResourceLoader(), Html\inlineStyle(), Html\linkedStyle(), list, makeContext(), Html\rawElement(), and ResourceLoaderModule\TYPE_STYLES.
Referenced by getLoad().
ResourceLoaderClientHtml::setConfig | ( | array | $vars | ) |
Set mw.config variables.
array | $vars | Array of key/value pairs |
Definition at line 80 of file ResourceLoaderClientHtml.php.
ResourceLoaderClientHtml::setExemptStates | ( | array | $states | ) |
Set state of special modules that are handled by the caller manually.
See OutputPage::buildExemptModules() for use cases.
array | $states | Module state keyed by module name |
Definition at line 121 of file ResourceLoaderClientHtml.php.
ResourceLoaderClientHtml::setModules | ( | array | $modules | ) |
Ensure one or more modules are loaded.
array | $modules | Array of module names |
Definition at line 91 of file ResourceLoaderClientHtml.php.
References $modules.
ResourceLoaderClientHtml::setModuleScripts | ( | array | $modules | ) |
Ensure the scripts of one or more modules are loaded.
array | $modules | Array of module names |
Definition at line 110 of file ResourceLoaderClientHtml.php.
References $modules.
ResourceLoaderClientHtml::setModuleStyles | ( | array | $modules | ) |
Ensure the styles of one or more modules are loaded.
array | $modules | Array of module names |
Definition at line 100 of file ResourceLoaderClientHtml.php.
References $modules.
|
private |
Definition at line 41 of file ResourceLoaderClientHtml.php.
|
private |
Definition at line 32 of file ResourceLoaderClientHtml.php.
Referenced by __construct(), getData(), makeContext(), and makeLoad().
|
private |
Definition at line 56 of file ResourceLoaderClientHtml.php.
Referenced by getBodyHtml(), getData(), and getHeadHtml().
|
private |
Definition at line 53 of file ResourceLoaderClientHtml.php.
|
private |
Definition at line 44 of file ResourceLoaderClientHtml.php.
Referenced by getLoad(), makeLoad(), setModules(), setModuleScripts(), and setModuleStyles().
|
private |
Definition at line 50 of file ResourceLoaderClientHtml.php.
|
private |
Definition at line 47 of file ResourceLoaderClientHtml.php.
|
private |
Definition at line 38 of file ResourceLoaderClientHtml.php.
|
private |
Definition at line 35 of file ResourceLoaderClientHtml.php.
Referenced by getData().