Manual:Hooks/ApiParseMakeOutputPage

From Linux Web Expert

ApiParseMakeOutputPage
<translate> Available from <tvar name=1><translate> version <tvar (Gerrit change 340768)</tvar></translate>
Called when preparing the OutputPage object for ApiParse. This is mainly intended for calling OutputPage::addContentOverride() or OutputPage::addContentOverrideCallback().
<translate> Define function:</translate>
public static function onApiParseMakeOutputPage( ApiBase $module, OutputPage $output ) { ... }
<translate> Attach hook:</translate> <translate> In <tvar name=1>extension.json</tvar>:</translate>
{
	"Hooks": {
		"ApiParseMakeOutputPage": "MediaWiki\\Extension\\MyExtension\\Hooks::onApiParseMakeOutputPage"
	}
}
<translate> Called from:</translate> <translate> File(s):</translate> api/ApiParse.php
<translate> Function(s):</translate> execute
<translate> Interface:</translate> ApiParseMakeOutputPageHook.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:ApiParseMakeOutputPage extensions</tvar>.</translate>


Details

  • $module: ApiBase (which is also a ContextSource)
  • $output: OutputPage