Manual:Hooks/ParserFetchTemplate
Jump to navigation
Jump to search
![]() | This deprecated feature should no longer be used, but is still available for reasons of backwards compatibility. This feature was deprecated in version 1.35.0. Please see BeforeParserFetchTemplateRevisionRecord for an alternative way to use this feature. |
ParserFetchTemplate | |
---|---|
Available from version 1.28.0 (Gerrit change 307073) Called when the parser fetches a template | |
Define function: | public static function onParserFetchTemplate( $parser, Title $title, Revision $revision, &$text, array &$deps ) { ... }
|
Attach hook: | In extension.json:
{
"Hooks": {
"ParserFetchTemplate": "MyExtensionHooks::onParserFetchTemplate"
}
}
|
Called from: | File(s): parser/Parser.php Function(s): statelessFetchTemplate |
Interface: | ParserFetchTemplateHook.php |
For more information about attaching hooks, see Manual:Hooks .
For examples of extensions using this hook, see Category:ParserFetchTemplate extensions.
Details[edit]
$parser
: Parser object or false$title
: Title object of the template to be fetched$rev
: Revision object of the template&$text
: Transclusion text of the template or false or null&$deps
: Array of template dependencies with 'title', 'page_id', 'rev_id' keys