Manual:Hooks/ResourceLoaderGetLessVars

From Linux Web Expert

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