i'm a bit confused about modules, namespace and reflection.
$obj = new default_Model_foo();
$obj->bar();
The code above runs prope开发者_如何学Crly, but i need to add reflection;
I've got these variables:
$moduleName = "default";
$modelName = "foo";
$function = "bar";
I would like to instantiate a class at runtime, how can do it?
Thank you! Mirco.
$modelClass = "{$moduleName}_Model_{$modelName}";
$obj = new $modelClass();
$obj->$function();
精彩评论