Hi and thanks for the help. I think I haven't explained my problem right. Anyway, it turned out that in my case, this wasn't the problem at all. I know everything you said, but I was mistaken at something else. An btw, isn't this valid
Code: Select all
public function __construct($c = '')
I think this is not overriding the value I pass, this is a default value in case I don't pass a value
http://www.php.net/manual/en/functions.arguments.php
However, my problem is something else. I'm have to get a class name from a config file (array) and create a new object from the returned string. Everything's ok, I get the value and return a string. But when I create the object:
Code: Select all
$model = Config::get($conf_file);
$a = new $model;
return $a;
It returns an error: "Class name must be a valid object or a string". I am absolutely sure that the $conf_file var is pointing to the right file, because the $model var contains the right class name. If I put a static value like:
everithing works ok. Any idea what am I doing wrong?