Manual:Hooks/ResourceLoaderGetLessVars
From Linux Web Expert
File:OOjs UI icon alert-destructive.svg | <translate> This feature was removed completely in version <tvar name=ver>1.31.0</tvar> (after being deprecated in <tvar name=4>1.30.0</tvar>).</translate>
This hook was removed due to concerns about allowing unmaintainable cross-dependencies. Custom ResourceLoaderModule subclasses can override the getLessVars() method instead. |
ResourceLoaderGetLessVars | |
---|---|
<translate> Available from <tvar name=1><translate> version <tvar (Gerrit change 187986)</tvar></translate> <translate> Removed in <tvar name=1><translate> version <tvar (Gerrit change 425273)</tvar></translate> Allows to add context-based Less variables. | |
<translate> Define function:</translate> | public static function onResourceLoaderGetLessVars( array &$lessVars ) { ... }
|
<translate> Attach hook:</translate> | <translate> In <tvar name=1>extension.json</tvar>:</translate>
{
"Hooks": {
"ResourceLoaderGetLessVars": "MediaWiki\\Extension\\MyExtension\\Hooks::onResourceLoaderGetLessVars"
}
}
|
<translate> Called from:</translate> | <translate> File(s):</translate> resourceloader/ResourceLoader.php |
<translate> Interface:</translate> | ResourceLoaderGetLessVarsHook.php |
<translate> For more information about attaching hooks, see <tvar name=1>Manual:Hooks </tvar>.</translate>
<translate> For examples of extensions using this hook, see <tvar name=cat>Category:ResourceLoaderGetLessVars extensions</tvar>.</translate>
Details
&$lessVars
: An array of already added variables, which can be extended
See also
- $wgResourceLoaderLESSVars (now also removed)