Recent Changes - Search:

PmWiki

pmwiki.org

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


This is a talk page for improving PmWiki.OtherVariables.

Edit - History - Print - Recent Changes - Search
Page last modified on May 15, 2013, at 06:42 PM