docs: Update ParserGetVariableValueSwitch documentation
It never makes sense to pass a (possibly different) Parser or PPFrame object *back* as a reference. The & are a relic from very old PHP versions that cloned all objects before passing them. This is not needed any more. Change-Id: I9fdb184cb41a61842819d44c9f07bd9cf435bb14
This commit is contained in:
parent
e9daa066fe
commit
946f35705b
2 changed files with 7 additions and 7 deletions
|
|
@ -2586,12 +2586,12 @@ $rev: Revision object of the template
|
|||
|
||||
'ParserGetVariableValueSwitch': Called when the parser need the value of a
|
||||
custom magic word
|
||||
&$parser: Parser object
|
||||
&$varCache: array to store the value in case of multiples calls of the
|
||||
$parser: Parser object
|
||||
&$variableCache: array to store the value in case of multiples calls of the
|
||||
same magic word
|
||||
&$index: index (string) of the magic
|
||||
&$magicWordId: index (string) of the magic word
|
||||
&$ret: value of the magic word (the hook should set it)
|
||||
&$frame: PPFrame object to use for expanding any template variables
|
||||
$frame: PPFrame object to use for expanding any template variables
|
||||
|
||||
'ParserGetVariableValueTs': Use this to change the value of the time for the
|
||||
{{LOCAL...}} magic word.
|
||||
|
|
|
|||
|
|
@ -49,9 +49,9 @@ function wfAddCustomMagicWordID( &$magicWords ) {
|
|||
return true;
|
||||
}
|
||||
|
||||
function wfGetCustomMagicWordValue( &$parser, &$varCache, &$index, &$ret ){
|
||||
if( $index == 'mag_custom' ){
|
||||
$ret = $varCache['mag_custom'] = "Custom value";
|
||||
function wfGetCustomMagicWordValue( $parser, &$variableCache, &$magicWordId, &$ret ){
|
||||
if( $magicWordId == 'mag_custom' ){
|
||||
$ret = $variableCache['mag_custom'] = "Custom value";
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue