MediaWiki
1.34.0
|
Load and configure a ResourceLoader client on an HTML page. More...
Public Member Functions | |
__construct (ResourceLoaderContext $context, array $options=[]) | |
getBodyHtml () | |
getDocumentAttributes () | |
getHeadHtml ( $nojsClass=null) | |
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... | |
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 | $moduleStyles = [] |
array | $options |
ResourceLoader | $resourceLoader |
Load and configure a ResourceLoader client on an HTML page.
Definition at line 30 of file ResourceLoaderClientHtml.php.
ResourceLoaderClientHtml::__construct | ( | ResourceLoaderContext | $context, |
array | $options = [] |
||
) |
ResourceLoaderContext | $context | |
array | $options | [optional] Array of options
|
Definition at line 63 of file ResourceLoaderClientHtml.php.
References $context, $options, and ResourceLoaderContext\getResourceLoader().
ResourceLoaderClientHtml::getBodyHtml | ( | ) |
Definition at line 341 of file ResourceLoaderClientHtml.php.
|
private |
Definition at line 356 of file ResourceLoaderClientHtml.php.
References $type, and makeContext().
Referenced by getData().
|
private |
Definition at line 116 of file ResourceLoaderClientHtml.php.
References $context, $data, $resourceLoader, and getContext().
Referenced by getBodyHtml(), and getHeadHtml().
ResourceLoaderClientHtml::getDocumentAttributes | ( | ) |
Definition at line 228 of file ResourceLoaderClientHtml.php.
Referenced by getHeadHtml().
ResourceLoaderClientHtml::getHeadHtml | ( | $nojsClass = null | ) |
The order of elements in the head is as follows:
Reasons:
string | null | $nojsClass | Class name that caller uses on HTML document element |
Definition at line 247 of file ResourceLoaderClientHtml.php.
References $data, getData(), getDocumentAttributes(), and getLoad().
|
private |
Definition at line 360 of file ResourceLoaderClientHtml.php.
References $modules, and makeLoad().
Referenced by getHeadHtml().
|
staticprivate |
Definition at line 364 of file ResourceLoaderClientHtml.php.
References $context, $type, ResourceLoaderContext\getContentOverrideCallback(), ResourceLoaderContext\getRequest(), and ResourceLoaderContext\getResourceLoader().
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 393 of file ResourceLoaderClientHtml.php.
References $context, $modules, $source, ResourceLoaderContext\encodeJson(), ResourceLoaderContext\getDebug(), ResourceLoaderContext\getRaw(), ResourceLoaderContext\getResourceLoader(), and makeContext().
Referenced by getLoad().
ResourceLoaderClientHtml::setConfig | ( | array | $vars | ) |
Set mw.config variables.
array | $vars | Array of key/value pairs |
Definition at line 78 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 109 of file ResourceLoaderClientHtml.php.
ResourceLoaderClientHtml::setModules | ( | array | $modules | ) |
Ensure one or more modules are loaded.
array | $modules | Array of module names |
Definition at line 89 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 98 of file ResourceLoaderClientHtml.php.
References $modules.
|
private |
Definition at line 42 of file ResourceLoaderClientHtml.php.
|
private |
Definition at line 33 of file ResourceLoaderClientHtml.php.
Referenced by __construct(), getData(), makeContext(), and makeLoad().
|
private |
Definition at line 54 of file ResourceLoaderClientHtml.php.
Referenced by getBodyHtml(), getData(), and getHeadHtml().
|
private |
Definition at line 51 of file ResourceLoaderClientHtml.php.
|
private |
Definition at line 45 of file ResourceLoaderClientHtml.php.
Referenced by getLoad(), makeLoad(), setModules(), and setModuleStyles().
|
private |
Definition at line 48 of file ResourceLoaderClientHtml.php.
|
private |
Definition at line 39 of file ResourceLoaderClientHtml.php.
Referenced by __construct().
|
private |
Definition at line 36 of file ResourceLoaderClientHtml.php.
Referenced by getData().