[pmwiki-devel] Page Vars - A Little Help?
    Steven Leite 
    steven_leite at kitimat.net
       
    Fri Mar 25 04:05:00 CDT 2011
    
    
  
I'm having a bit of trouble trying to add a Page Variable via my script.
Reference: http://www.pmwiki.org/wiki/PmWiki/PageVariables
Here's my hook (for testing purposes):
*Markup("MyFunction)", "<directives", "/\\(:setpv (.*?):\)/e", 
'my_function("$1");');*
So, if I were to type:*(:setpv price="$39.99":)* on a page, I should be 
able to referencing {$price}  when I need to.
For example: *The price you entered was {$price}.*
Unfortunately that doesn't seem to be working...
Here's a sample function:
*my_function($args)
{
$my_vars = ParseArgs($args);
if (isset($my_vars['price']))
*
    *{
       // set page variable for 'price'
       $price = $my_vars['price'];
       $FmtPV['$price'] = "$price";
    }
    *
*return;
}*
That should have set the Page Variable {$price} which should be 
accessible on any page,
however, when I edit the page and place {$price} on it, nothing shows up.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.pmichaud.com/pipermail/pmwiki-devel/attachments/20110325/77c8d238/attachment.html>
    
    
More information about the pmwiki-devel
mailing list