Manual:Hooks/RequestContextCreateSkin

From Linux Web Expert

RequestContextCreateSkin
<translate> Available from <tvar name=1><translate> version <tvar </tvar></translate>
Called when creating a skin instance.
<translate> Define function:</translate>
public static function onRequestContextCreateSkin( IContextSource $context, Skin &$skin ) { ... }
<translate> Attach hook:</translate> <translate> In <tvar name=1>extension.json</tvar>:</translate>
{
	"Hooks": {
		"RequestContextCreateSkin": "MediaWiki\\Extension\\MyExtension\\Hooks::onRequestContextCreateSkin"
	}
}
<translate> Called from:</translate> <translate> File(s):</translate> context/RequestContext.php
<translate> Function(s):</translate> getSkin
<translate> Interface:</translate> RequestContextCreateSkinHook.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:RequestContextCreateSkin extensions</tvar>.</translate>


Details

  • $context: An IContextSource instance
  • &$skin: Null (this is a variable reference you may set a Skin instance or string key on to override the skin that will be used for the context)