[pmwiki-devel] having a single callback function for markups in php 5.5x compat issues

V.Krishn vkrishn4 at gmail.com
Sat Apr 2 03:41:17 CDT 2016


Hi,

While converting another recipe for making compatible with php 5.5x,
was thinking if for a given markup, eg.

(:test param1 param2 param3:)

CODE:
-----
Markup('test','directives','/\\(:test\\s(.*?):\\)/',"CallbackTest");

function CallbackTest($m) {
  print_r($m);
}
---------

it produces the following array.

Array
(
    [0] => (:test param1 param2 param3:)
    [1] => test param1 param2 param3
)

Wondering if were possible to produce:

Array
(
    [0] => (:test param1 param2 param3:)
    [1] => test param1 param2 param3
    [name] => test
)

One benefit is I can write a single CallBack<fn> for all markups in given 
recipe.

function CallbackTest($m) {
 switch ($i) {
    case "test":
        return Function1($m[1]);
        break;
    case "test2":
        return Function1($m[1]);
        break;
 }
}

Been away from pmwiki development for awhile, so pls point me to docs if  
something similar already exists or something better has comeup in ml.

-- 
Regards.
V.Krishn



More information about the pmwiki-devel mailing list