[Pmwiki-users] Question to new page format variables

Patrick R. Michaud pmichaud at pobox.com
Sat Jun 14 10:28:13 CDT 2003


On Sat, Jun 14, 2003 at 08:37:30AM +0200, Bernhard Weichel in pmwiki-users wrote:
> Now my questions:
> 
> 1. does it matter (e.g. is there a performance impact) if I use
> 
>    PrintFmt($pagename, "wiki:\$Group.\$Title")    versus
>    PrintWikiPage("\$Grouip.\$Title")
> 
> If it doesn't matter, why do we need PrintWikiPage?

Well, I had never really intended for people to call PrintFmt directly
(although I certainly don't exclude the possibility).  For example,
instead of doing

     <?php PrintFmt($pagename, "function:PrintGeneralMenu"); ?>

I would've written

     <?php PrintGeneralMenu($pagename); ?>

using PHP's built-in function calling syntax.  Similarly, instead of

     <?php PrintFmt($pagename, "file:somefile.php"); ?>

I would expect

     <?php include("somefile.php"); ?>

However, there is no PHP equivalent function for displaying a wiki page,
so I wrote one and called it PrintWikiPage(), thinking that would be
easier for most people than calling PrintFmt().

> 2. If I use PrintFmt($pagename, "wiki:\$Group.Menu default.Menu")
>    Is there a way to find out which page is actually printed. This is
> important
>    since I want to specify e.g. a general link to "Edit Menu" within the
> function
>    PrintGeneralMenu.

At present, no.  I could modify PrintWikiPage or PrintText to set a
global variable containing the name of the page that is actually being
printed (if so, what should it be called)?

Pm




More information about the pmwiki-users mailing list