[pmwiki-users] Re: Re: Re: Some documentation added for "markup variables" (Was: How to add a variable to {$var}-markup?)

Patrick R. Michaud pmichaud at pobox.com
Tue Jul 5 16:28:02 CDT 2005


On Tue, Jul 05, 2005 at 11:12:54PM +0200, chr at home.se wrote:
> On Tue, 5 Jul 2005, Patrick R. Michaud wrote:
> Guess I wasn't clear enough this time either... :-)
> 
> So how about if you look at this example and tell me if it'll fly... 
> 
> 	http://www.pmwiki.org/wiki/PmWiki/MarkupVariables#ex1

Well, not exactly.  The example says "name of current group using
only lowercase letters", but doesn't give that.  You really want

    $GLOBALS['mygroup'] = lower(FmtPageName('$Group', $pagename));

Of course, one doesn't need to use $GLOBALS at all for this --
for this particular example it seems just as easy to do:

    Markup('{$mygroup}', '>{$fmt}',
      '/\\{\\$mygroup\\}/', 
      lower(FmtPageName('$Group', $pagename)));

    Markup('{$Var1}', '>{$fmt}', '/\\{\\$Var1\\}/', 'Variable 1');
    Markup('{$Var2}', '>{$fmt}', '/\\{\\$Var2\\}/', 'Variable 2');

In other words, it's not exactly clear what advantage $GLOBALS has
here...

Pm



More information about the pmwiki-users mailing list