Manual:Hooks/SkinTemplateOutputPageBeforeExec

From MediaWiki.org
Jump to: navigation, search
SkinTemplateOutputPageBeforeExec
Available from version 1.10.0 (r19063)
allows further setup of the template engine after all standard setup has been performed but before the skin has been rendered

Define function:
public static function onSkinTemplateOutputPageBeforeExec( &$skin, &$template ) { ... }

Attach hook:
$wgHooks['SkinTemplateOutputPageBeforeExec'][] = 'MyExtensionHooks::onSkinTemplateOutputPageBeforeExec';
Called from: SkinTemplate.php

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


Example[edit | edit source]

$wgHooks['SkinTemplateOutputPageBeforeExec'][] = function ( &$skin, &$template ) {
	$template->set( 'key', 'value' );
	$someVar = 'asdf';
	$template->setRef( 'key', $someVar );
	$template->data['key'];
	return true;
};