[pmwiki-devel] FmtPV[] defined in markup function?

Patrick R. Michaud pmichaud at pobox.com
Thu Apr 26 17:02:35 CDT 2007


On Thu, Apr 26, 2007 at 07:42:04PM +0100, Hans wrote:
> Thursday, April 26, 2007, 7:25:42 PM, Patrick wrote:
> 
> > I think I need a much more concrete example.
> 
> trying to condense the problem:
> {$TestPV} is failed to be set.
> "Test" is just to illustrate. It will be a number calculated
> inside the function.
> 
> Markup('testpv','directives','/\\(:testpv:\\)/e',
>       "TestPVMarkup(\$pagename)");
>       
> function TestPVMarkup ($pagename) {
>   global $FmtPV;
>   $FmtPV['$TestPV'] = '"Test"';
>   return '';
> }

There's an issue here of sequencing -- markup rules with
a when value of 'directives' some time after the {$var}
markup rule.  So, by the time the (:testpv:) directive is
processed, it's too late to set $FmtPV[] to be used as
a page variable (at least, for the current page).

Pm



More information about the pmwiki-devel mailing list