[pmwiki-users] $Group, $Name in Markup definition

DaveG pmwiki at solidgone.com
Mon Feb 13 08:53:01 CST 2012



On 2/13/2012 4:05 AM, Anton Shevtsov wrote:
> Hi
>
> How i can access to $Group, $Name variable from custom Markup?
>
> example:
>
> Markup("get_content", "directives",
> '/\(:get_content\s+\((.+?)\):\)/e',"_get_content($1)");
> .....
> .....
> function _get_content($filename)
> {
> $foo=file_get_contents($mypath.$Group.'/'.$Name.'/'.$filename);
> return $foo;
> }
Using global:
function _get_content($filename)
{
global $Name;
$foo=file_get_contents($mypath.$Group.'/'.$Name.'/'.$filename);
return $foo;
}




More information about the pmwiki-users mailing list