I get for example name=carl from the url in FooStatic and want to initiate the $Name with Carl so I can use it from another function. Can I do that? Or is there some other better way to do that?
class Foo {
private static $Name = "name";
public static function FooStatic(){
if (isset($_GET["name"])){
self::$Name = $_GET["name"];
return true;
} else {
return false;
}
}
I am using the name to get more info from another class
public static function getSomething() {
if (isset($_GET[self::$Name])) {
$name = $_GET[self::$Name];
$ret = $someClass->Foo($name);
return $ret;
}
}