[Mediawiki-l] parserfunctions question: evaluate vs. display?

Daniel Barrett danb at VistaPrint.com
Tue Apr 8 18:57:54 UTC 2008


Thanks for your analysis, Rolf.

I just looked at the PHP source of ParserFunctions, however, and #if is
not evaluating anything:

function ifHook( &$parser, $test = '', $then = '', $else = '' ) {
  if ( $test !== '' ) {
    return $then;
  } else {
    return $else;
  }
}
$wgParser->setFunctionHook( 'if', array( &$wgExtParserFunctions,
'ifHook' ) );

So the values of $then and $else are getting evaluated somewhere else.
Does this mean the issue lies with MediaWiki, not with ParserFunctions?

DanB



More information about the MediaWiki-l mailing list