[Pmwiki-users] Variables expansion in included files

Patrick R. Michaud pmichaud
Mon Jul 28 11:44:46 CDT 2003

Because the files are included from within PmWiki's PrintFmt function,
you may need to declare embedded variables as global if you want the 
substitutions to take place:

   <div class="small"><?php 
     global $PageUpdate; echo "Last update $PageUpdate"; ?></div>

Also make sure that $PageUpdate is actually being set with a value
somewhere in your scripts--this is not a variable that PmWiki normally 
sets (PmWiki uses $LastModified for this purpose).


On Mon, Jul 28, 2003 at 04:36:17PM +0200, S?bastien Pierre wrote:
> Hi all,
> I have customised PmWiki using this simple local.php file:
> $HTMLHeaderFmt = "file:local/header.php";
> $HTMLBodyFmt   = "<body>";
> $PageHeaderFmt = "file:local/page-header.php";
> $PageFooterFmt = "file:local/page-footer.php";
> $HTMLEndFmt   = "</body></html>";
> My page-header.php file contains (among others( the following line:
> 	<div class="small"><?php echo "Last update $PageUpdate"; ?></div>
> The problem is that the $PageUpdate is expanded into an empty string, 
> which seems to imply that PHP cannot resolve the variables when 
> interpreting expressions nested in imported file. I'm pretty sure there 
> is another (right) way to use PmWiki page variables in imported PHP 
> files, so I would be pleased if anybody could explain me.
> TIA,
>  -- S?bastien
> --
> ?Le soleil est Dieu?
> <http://www.type-z.org>             -- Turner, avant de mourir
> _______________________________________________
> Pmwiki-users mailing list
> Pmwiki-users at pmichaud.com
> http://pmichaud.com/mailman/listinfo/pmwiki-users_pmichaud.com

More information about the pmwiki-users mailing list