< Manual:Hooks
ParserCloned | |
---|---|
Available from version 1.21.0 (Gerrit change 33506) called when the Parser is cloned | |
Define function: | public static function onParserCloned( $parser ) { ... }
|
Attach hook: | In extension.json:
{
"Hooks": {
"ParserCloned": "MyExtensionHooks::onParserCloned"
}
}
|
Called from: | File(s): Parser.php |
Interface: | ParserClonedHook.php |
For more information about attaching hooks, see Manual:Hooks
For examples of extensions using this hook, see Category:ParserCloned extensions.
Details
$parser: Newly-cloned Parser object
Purpose
Extensions should use this hook if they store per-instance data in "expando" properties on the Parser object that need to be deep-cloned or cleared for the new Parser object.
This article is issued from Mediawiki. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.