MediaWiki master
|
Load and configure a ResourceLoader client on an HTML page. More...
Public Member Functions | |
__construct (Context $context, array $options=[]) | |
getBodyHtml () | |
getDocumentAttributes () | |
getHeadHtml ( $nojsClass=null) | |
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. | |
setModuleStyles (array $modules) | |
Ensure the styles of one or more modules are loaded. | |
Static Public Member Functions | |
static | makeLoad (Context $mainContext, array $modules, $only, array $extraQuery=[]) |
Explicitly load or embed modules on a page. | |
Public Attributes | |
const | CLIENT_PREFS_COOKIE_NAME = 'mwclientpreferences' |
Used by extensions to apply anonymous user preferences across domains during the authentication flow. | |
Load and configure a ResourceLoader client on an HTML page.
Definition at line 33 of file ClientHtml.php.
MediaWiki\ResourceLoader\ClientHtml::__construct | ( | Context | $context, |
array | $options = [] ) |
Context | $context | |
array | $options | [optional] Array of options
|
Definition at line 78 of file ClientHtml.php.
References MediaWiki\ResourceLoader\Context\getResourceLoader().
MediaWiki\ResourceLoader\ClientHtml::getBodyHtml | ( | ) |
Definition at line 387 of file ClientHtml.php.
MediaWiki\ResourceLoader\ClientHtml::getDocumentAttributes | ( | ) |
Definition at line 247 of file ClientHtml.php.
MediaWiki\ResourceLoader\ClientHtml::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 306 of file ClientHtml.php.
|
static |
Explicitly load or embed modules on a page.
Context | $mainContext | |
string[] | $modules | One or more module names |
string | $only | Module TYPE_ class constant |
array | $extraQuery | [optional] Array with extra query parameters for the request |
Definition at line 443 of file ClientHtml.php.
References $source, $url, MediaWiki\ResourceLoader\Context\encodeJson(), MediaWiki\ResourceLoader\Context\getDebug(), and MediaWiki\ResourceLoader\Context\getResourceLoader().
MediaWiki\ResourceLoader\ClientHtml::setConfig | ( | array | $vars | ) |
Set mw.config variables.
array | $vars | Array of key/value pairs |
Definition at line 94 of file ClientHtml.php.
Referenced by MediaWiki\Output\OutputPage\getRlClient().
MediaWiki\ResourceLoader\ClientHtml::setExemptStates | ( | array | $states | ) |
Set state of special modules that are handled by the caller manually.
See OutputPage::buildExemptModules() for use cases.
array<string,string> | $states Module state keyed by module name |
Definition at line 125 of file ClientHtml.php.
MediaWiki\ResourceLoader\ClientHtml::setModules | ( | array | $modules | ) |
Ensure one or more modules are loaded.
string[] | $modules | Array of module names |
Definition at line 105 of file ClientHtml.php.
MediaWiki\ResourceLoader\ClientHtml::setModuleStyles | ( | array | $modules | ) |
Ensure the styles of one or more modules are loaded.
string[] | $modules | Array of module names |
Definition at line 114 of file ClientHtml.php.
const MediaWiki\ResourceLoader\ClientHtml::CLIENT_PREFS_COOKIE_NAME = 'mwclientpreferences' |
Used by extensions to apply anonymous user preferences across domains during the authentication flow.
This name doesn't include the cookie prefix which can be the ID of the domain we're on. See $wgCookiePrefix for that.
Definition at line 44 of file ClientHtml.php.