I have a factory pattern like this:
public function ViewFactory implements Factory {
public function __construct() {
}
public static function Create($params) {
//does not return variables, only extracts them
$p = extract($params, EXTR_PREFIX_ALL, "var_");
//return object of view and pass in all variables extracted from array
return new View($p);
}
***
***
}
interface Factory {
public function Create($params);
***
***
}
Im trying to use extract but it does not return variables I just have to access them using keys from associative array prefixed by var_. Is it possible to somehow return all values of array as variables comma separated and pass it into function?
My View Class:
class View {
public function __construct($path, $parameters, $site_title) {
***
};
}