On Mon, Feb 13, 2012 at 8:53 AM, DaveG <[email protected]> wrote: > On 2/13/2012 4:05 AM, Anton Shevtsov wrote: >> 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; > }
You should also include $Group (and possibly $mypath) in that global declaration. Check the following in the php manual: < http://us.php.net/manual/en/language.variables.scope.php > _______________________________________________ pmwiki-users mailing list [email protected] http://www.pmichaud.com/mailman/listinfo/pmwiki-users
