[pmwiki-devel] Creating a page text variable in a recipe

DaveG pmwiki at solidgone.com
Sat Sep 26 21:44:08 CDT 2009



On 9/26/2009 10:23 PM, Simon wrote:
> Thank for your suggestions and help.
> The variable $title is calculated from the contents processed within the
> ChordPro markup,
> and I want to make the value held in $title available in for use outside
> the ChordPro markup, eg in pagelists etc.
> I have added the global declaration to my function. (in front of the
> lines shown in my example).
As Peter pointed out, if all this is occurring inside a function, you 
need to make sure you've declared $FmtPV as global, and may need to be 
aware of processing sequencing. Declare as global below:

function myfunc(){
global $FmtPV;

    $FmtPV['$SongTitle'] = '$GLOBALS["title"]';

}


  ~ ~ David



More information about the pmwiki-devel mailing list