A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.mediawiki.org/wiki/Manual:Hooks/OutputPageParserOutput below:

Manual:Hooks/OutputPageParserOutput - MediaWiki

OutputPageParserOutput Available from version 1.6.0
Called after parse, before the HTML is added to the output
Define function:
public static function onOutputPageParserOutput( OutputPage $out, ParserOutput $parserOutput ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"OutputPageParserOutput": "MediaWiki\\Extension\\MyExtension\\Hooks::onOutputPageParserOutput"
	}
}
Called from: File(s): Output/OutputPage.php
Function(s): addParserOutputMetadata Interface: OutputPageParserOutputHook.php

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

Called directly after the LanguageLinks hook is provided.

Setting Parser properties for use by this hook[edit]

Are you contributing to an extension and want to set a parser property that can later be used by the OutputPageParserOutput hook? The ParserOutput::setExtensionData() and ::appendExtensionData() methods are available for your purpose.

For instance, if somewhere in your code, you define a property like:

$parser->getOutput()->setExtensionData( 'my_ext_foo', '...' );

In your method for this hook, you can fetch the value from the ParserOutput like this:

$parserOutput->getExtensionData( 'my_ext_foo' );

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4