[pmwiki-devel] FW: getting started

J. Meijer commentgg at hotmail.com
Wed Nov 29 17:03:27 CST 2006


 
Try
 
Markup('testdata', 'directives',
   '/\\(:testdata (.*?)\\s*:\\)/ei',
    "GetTestData('$1'        )              ");
 
 Note the parenthesis. Haven't tested this, but wrong anyway. 
 
 Tip: remove the 'e' in /regex/ei when things go wrong. You'll then be able to verify that the regex is indeed matching, and what PHP will see (execute) when it has matched. That sometimes helps a *lot*. 
 
 Goodluck!
 
 /jm
 
 
 
> On 11/29/06,  dso <dso at moosoft.com> wrote:
> 
> I am trying to make the most basic recipe possible.
> 
> Here's what I have:
> 
> <?php if (!defined('PmWiki')) exit ();
> 
> define(TESTDATA_VERSION, '2006-11-29a');
> 
> Markup('testdata', 'directives',
>   '/\\(:testdata (.*?)\\s*:\\)/ei',
>    "GetTestData('$1'");
> 
> function GetTestData($str) {
>    return "test";
> }
> 
> I either get the directive as text or an error about evaluation.
> 
> 
> _________________________________________________________________
> All-in-one security and maintenance for your PC.  Get a free 90-day trial!
> http://www.windowsonecare.com/purchase/trial.aspx?sc_cid=wl_wlmail

_________________________________________________________________
Express yourself with gadgets on Windows Live Spaces
http://discoverspaces.live.com?source=hmtag1&loc=us


More information about the pmwiki-devel mailing list