MediaWiki REL1_31
|
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: | |
setConfig (array $vars) | |
Set mw.config variables. | |
setExemptStates (array $states) | |
Set state of special modules that are handled by the caller manually. | |
setModules (array $modules) | |
Ensure one or more modules are loaded. | |
setModuleScripts (array $modules) | |
Ensure the scripts of one or more modules are loaded. | |
setModuleStyles (array $modules) | |
Ensure the styles of one or more modules are loaded. | |
Static Public Member Functions | |
static | makeLoad (ResourceLoaderContext $mainContext, array $modules, $only, array $extraQuery=[]) |
Explicily load or embed modules on a page. | |
Private Member Functions | |
getContext ( $group, $type) | |
getData () | |
getLoad ( $modules, $only, 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 28 of file ResourceLoaderClientHtml.php.
ResourceLoaderClientHtml::__construct | ( | ResourceLoaderContext | $context, |
array | $options = [] ) |
ResourceLoaderContext | $context | |
array | $options | [optional] Array of options
|
Definition at line 62 of file ResourceLoaderClientHtml.php.
References $context, $options, ResourceLoaderContext\getResourceLoader(), and options().
ResourceLoaderClientHtml::getBodyHtml | ( | ) |
Definition at line 329 of file ResourceLoaderClientHtml.php.
|
private |
Definition at line 333 of file ResourceLoaderClientHtml.php.
References $type, and makeContext().
|
private |
Definition at line 122 of file ResourceLoaderClientHtml.php.
References $context, $data, $name, $resourceLoader, getContext(), ResourceLoaderModule\LOAD_STYLES, ResourceLoaderModule\TYPE_COMBINED, ResourceLoaderModule\TYPE_SCRIPTS, and ResourceLoaderModule\TYPE_STYLES.
Referenced by getHeadHtml().
ResourceLoaderClientHtml::getDocumentAttributes | ( | ) |
Definition at line 228 of file ResourceLoaderClientHtml.php.
ResourceLoaderClientHtml::getHeadHtml | ( | ) |
The order of elements in the head is as follows:
Reasons:
Definition at line 246 of file ResourceLoaderClientHtml.php.
References $data, getData(), getLoad(), ResourceLoader\makeConfigSetScript(), ResourceLoader\makeInlineScript(), ResourceLoader\makeLoaderStateScript(), options(), string, ResourceLoaderModule\TYPE_COMBINED, ResourceLoaderModule\TYPE_SCRIPTS, and ResourceLoaderModule\TYPE_STYLES.
|
private |
Definition at line 337 of file ResourceLoaderClientHtml.php.
References $modules, and makeLoad().
Referenced by getHeadHtml().
|
staticprivate |
Definition at line 341 of file ResourceLoaderClientHtml.php.
References $context, $req, $type, 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 |
Definition at line 366 of file ResourceLoaderClientHtml.php.
References $context, $modules, $name, $source, ResourceLoaderContext\getRaw(), list, makeContext(), ResourceLoader\makeInlineScript(), makeLoad(), and ResourceLoaderModule\TYPE_STYLES.
Referenced by getLoad(), OutputPage\headElement(), makeLoad(), OutputPage\makeResourceLoaderLink(), and ResourceLoaderClientHtmlTest\testMakeLoad().
ResourceLoaderClientHtml::setConfig | ( | array | $vars | ) |
Set mw.config variables.
array | $vars | Array of key/value pairs |
Definition at line 73 of file ResourceLoaderClientHtml.php.
Referenced by OutputPage\getRlClient().
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 115 of file ResourceLoaderClientHtml.php.
Referenced by OutputPage\getRlClient().
ResourceLoaderClientHtml::setModules | ( | array | $modules | ) |
Ensure one or more modules are loaded.
array | $modules | Array of module names |
Definition at line 84 of file ResourceLoaderClientHtml.php.
References $modules.
Referenced by OutputPage\getRlClient().
ResourceLoaderClientHtml::setModuleScripts | ( | array | $modules | ) |
Ensure the scripts of one or more modules are loaded.
array | $modules | Array of module names |
Definition at line 104 of file ResourceLoaderClientHtml.php.
References $modules.
Referenced by OutputPage\getRlClient().
ResourceLoaderClientHtml::setModuleStyles | ( | array | $modules | ) |
Ensure the styles of one or more modules are loaded.
array | $modules | Array of module names |
Definition at line 94 of file ResourceLoaderClientHtml.php.
References $modules.
Referenced by OutputPage\getRlClient().
|
private |
Definition at line 40 of file ResourceLoaderClientHtml.php.
|
private |
Definition at line 31 of file ResourceLoaderClientHtml.php.
Referenced by __construct(), getData(), makeContext(), and makeLoad().
|
private |
Definition at line 55 of file ResourceLoaderClientHtml.php.
Referenced by getData(), and getHeadHtml().
|
private |
Definition at line 52 of file ResourceLoaderClientHtml.php.
|
private |
Definition at line 43 of file ResourceLoaderClientHtml.php.
Referenced by getLoad(), makeLoad(), setModules(), setModuleScripts(), and setModuleStyles().
|
private |
Definition at line 49 of file ResourceLoaderClientHtml.php.
|
private |
Definition at line 46 of file ResourceLoaderClientHtml.php.
|
private |
Definition at line 37 of file ResourceLoaderClientHtml.php.
Referenced by __construct().
|
private |
Definition at line 34 of file ResourceLoaderClientHtml.php.
Referenced by getData().