Load and configure a ResourceLoader client on an HTML page.
More...
|
static | makeLoad (ResourceLoaderContext $mainContext, array $modules, $only, array $extraQuery=[], $nonce=null) |
| Explicitly load or embed modules on a page.
|
|
Load and configure a ResourceLoader client on an HTML page.
- Since
- 1.28
Definition at line 30 of file ResourceLoaderClientHtml.php.
◆ __construct()
◆ getBodyHtml()
ResourceLoaderClientHtml::getBodyHtml |
( |
| ) |
|
◆ getContext()
ResourceLoaderClientHtml::getContext |
( |
|
$group, |
|
|
|
$type |
|
) |
| |
|
private |
◆ getData()
ResourceLoaderClientHtml::getData |
( |
| ) |
|
|
private |
◆ getDocumentAttributes()
ResourceLoaderClientHtml::getDocumentAttributes |
( |
| ) |
|
◆ getHeadHtml()
ResourceLoaderClientHtml::getHeadHtml |
( |
|
$nojsClass = null | ) |
|
The order of elements in the head is as follows:
- Inline scripts.
- Stylesheets.
- Async external script-src.
Reasons:
- Script execution may be blocked on preceding stylesheets.
- Async scripts are not blocked on stylesheets.
- Inline scripts can't be asynchronous.
- For styles, earlier is better.
- Parameters
-
string | null | $nojsClass | Class name that caller uses on HTML document element |
- Returns
- string|WrappedStringList HTML
Definition at line 243 of file ResourceLoaderClientHtml.php.
References ResourceLoader\filter().
◆ getLoad()
ResourceLoaderClientHtml::getLoad |
( |
|
$modules, |
|
|
|
$only, |
|
|
|
$nonce, |
|
|
array |
$extraQuery = [] |
|
) |
| |
|
private |
◆ makeContext()
static ResourceLoaderClientHtml::makeContext |
( |
ResourceLoaderContext |
$mainContext, |
|
|
|
$group, |
|
|
|
$type, |
|
|
array |
$extraQuery = [] |
|
) |
| |
|
staticprivate |
◆ makeLoad()
static ResourceLoaderClientHtml::makeLoad |
( |
ResourceLoaderContext |
$mainContext, |
|
|
array |
$modules, |
|
|
|
$only, |
|
|
array |
$extraQuery = [] , |
|
|
|
$nonce = null |
|
) |
| |
|
static |
◆ setConfig()
ResourceLoaderClientHtml::setConfig |
( |
array |
$vars | ) |
|
◆ setExemptStates()
ResourceLoaderClientHtml::setExemptStates |
( |
array |
$states | ) |
|
Set state of special modules that are handled by the caller manually.
See OutputPage::buildExemptModules() for use cases.
- Parameters
-
array<string,string> | $states Module state keyed by module name |
Definition at line 108 of file ResourceLoaderClientHtml.php.
◆ setModules()
ResourceLoaderClientHtml::setModules |
( |
array |
$modules | ) |
|
◆ setModuleStyles()
ResourceLoaderClientHtml::setModuleStyles |
( |
array |
$modules | ) |
|
Ensure the styles of one or more modules are loaded.
- Parameters
-
string[] | $modules | Array of module names |
Definition at line 97 of file ResourceLoaderClientHtml.php.
◆ $config
array<string,mixed> ResourceLoaderClientHtml::$config = [] |
|
private |
◆ $context
◆ $data
array ResourceLoaderClientHtml::$data |
|
private |
◆ $exemptStates
array<string,string> ResourceLoaderClientHtml::$exemptStates = [] |
|
private |
◆ $modules
string [] ResourceLoaderClientHtml::$modules = [] |
|
private |
◆ $moduleStyles
string [] ResourceLoaderClientHtml::$moduleStyles = [] |
|
private |
◆ $options
array<string,string|null|false> ResourceLoaderClientHtml::$options |
|
private |
◆ $resourceLoader
The documentation for this class was generated from the following file: