[Mediawiki-l] help writing a parser function

Ittay Dror ittayd at qlusters.com
Mon Jan 1 01:19:19 UTC 2007


I'm trying to write a 'foreach' parser function. here is the code:
public function foreach2Hook(&$parser, $text = '', $pattern = '', $replacement = '', $insep = ',', $outsep = ',' ) {
                $text= trim( $text );
                $variables = explode(trim($insep), $text);
                $return = preg_replace(trim($pattern), trim($replacement), $variables);
                return implode(trim($outsep), $return);
        }   

my problem is that (i think) $text contains unprocessed text. i want the text after the wiki engine has gone over it, or, make it go over it (giving me the resulting html)

thanks,
ittay

-- 
===================================
Ittay Dror, 
Chief architect, openQRM group leader, 
R&D, Qlusters Inc.
ittayd at qlusters.com
+972-3-6081994 Fax: +972-3-6081841

www.openqrm.org - Data Center Provisioning



More information about the MediaWiki-l mailing list