[pmwiki-users] getting form variables

Stirling Westrup sti at pooq.com
Sat Mar 25 17:48:03 CST 2006


Tom Carchrae wrote:

> Markup('getarg', 'fulltext',
>    '/\\(:getarg (.*?):\\)/',
>    mygetarg('$1'));
> 
> i did some debugging, and i notice that part of the problem is
> the order of parsing the code.  for example, it appears that $1
> is passed to my function, instead of what $1 represents, eg
> 'name'.  so maybe this is my fault?  i tried '$1' -> $1 but
> that didnt work.
> 
> any tips/pointers appreciated.

I had the same problem when I was working on some complex markup. as I 
documented here:

http://www.pmwiki.org/wiki/Profiles/StirlingWestrup


The final solution that worked for me was to put the function name in 
single quotes, and the parameter in double, like this:

Markup('getarg', 'fulltext',
    '/\\(:getarg (.*?):\\)/',
     'mygetarg("$1")');




More information about the pmwiki-users mailing list