Manual:Hooks/AfterFinalPageOutput
Appearance
AfterFinalPageOutput | |
---|---|
Available from version 1.20.0 Nearly at the end of OutputPage::output(). | |
Define function: | public static function onAfterFinalPageOutput( $output ) { ... }
|
Attach hook: | In extension.json:
{
"Hooks": {
"AfterFinalPageOutput": "MediaWiki\\Extension\\MyExtension\\Hooks::onAfterFinalPageOutput"
}
}
|
Called from: | File(s): OutputPage.php |
Interface: | AfterFinalPageOutputHook.php |
For more information about attaching hooks, see Manual:Hooks .
For examples of extensions using this hook, see Category:AfterFinalPageOutput extensions.
Details
[edit]Nearly at the end of OutputPage::output()
but before OutputPage::sendCacheControl()
and final ob_end_flush()
which will send the buffered output to the client. This allows for last-minute modification of the output within the buffer by using ob_get_clean()
.
- $output: The OutputPage object where output() was called
How to use
[edit]$wgHooks['AfterFinalPageOutput'][] = 'fnAfterAll';
function fnAfterAll( $output ) {
$out = ob_get_clean();
// Modify $out
ob_start();
echo $out;
return true;
}