OtherVariables-Talk

I have in config.php

 $FmtPV['$Url'] = $_SERVER['HTTP_HOST'];

and on the wiki page[1] I access it using the markup

{$Url}

but it displays like this - wwwexamplecom

if anyone can point out the problem I'd appreciate it simon May 15, 2013, at 03:55 AM

You should use either one of these:

 $FmtPV['$Url'] = '"' . $_SERVER['HTTP_HOST'] . '"'; # or
 $FmtPV['$Url'] = '$_SERVER["HTTP_HOST"]';

The string is passed through eval() so it needs to be presented as a variable to be expanded, as a function or as a quoted string. I wonder how you don't have other problems such as completely blank page or many error messages with your definition. See Cookbook:MoreCustomPageVariables for other examples. --Petko May 15, 2013, at 04:51 AM


Is there a reason why the page cache is disabled by default? TomM? September 30, 2016, at 05:15 AM

Yes, when a webmaster installs PmWiki, s/he makes a lot of changes in the beginning, so it is better that every request is re-calculated. --Petko September 30, 2016, at 11:47 AM

This is a talk page for improving PmWiki.OtherVariables.