Jump to content

Extension:MobileFrontend/BeforePageDisplayMobile

From mediawiki.org
BeforePageDisplayMobile
Available from version master (Gerrit change 5146)
Allows last minute changes to the output page, e.g. adding of CSS or JavaScript in mobile only mode by extensions.
Define function:
public static function onBeforePageDisplayMobile( OutputPage $out, Skin $sk ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"BeforePageDisplayMobile": "MediaWiki\\Extension\\MyExtension\\Hooks::onBeforePageDisplayMobile"
	}
}
Called from: File(s): MobileFrontend extension/MobileFrontend.hooks.php
Interface: BeforePageDisplayMobileHook.php

For more information about attaching hooks, see Manual:Hooks .
For examples of extensions using this hook, see Category:BeforePageDisplayMobile extensions.


Details

[edit]
  • $out: The OutputPage object.
  • $sk: Skin object that will be used to generate the page.