I thought I had read somewhere that it was not a good idea to set
function hooks inside of a class in this way.
what follows is just one of many examples out there:

$wgExtensionFunctions[]        = 'wfSetupCSS'

function wfSetupCSS() {
    global $wgCSS;
    $wgCSS = new CSS();
}

class CSS {

    function CSS() {
        global $wgParser, $wgCSSMagic;
        $wgParser->setFunctionHook($wgCSSMagic, array($this, 'magicCss'));
        }


Any other suggestions on how to implement this type of functionality.
Would it be better not to instantiate the CSS
class and just use a static class with a function to set the hook like this:

$wgExtensionFunctions[]        = 'CSS::SetupCSS'

Where SetupCSS was a static function to set the hook.

Sorry if the question appears a bit dumb but I'm interested to hear
what the more experienced guys think.

Thanks,

Richard
_______________________________________________
MediaWiki-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l

Reply via email to