Extension:MobileFrontend/BeforePageDisplayMobile

From MediaWiki.org
Jump to navigation Jump to search
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": "MyExtensionHooks::onBeforePageDisplayMobile"
	}
}

For MediaWiki ≤1.25:

$wgHooks['BeforePageDisplayMobile'][] = 'MyExtensionHooks::onBeforePageDisplayMobile';
Called from:File(s): MobileFrontend extension/MobileFrontend.hooks.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.