Hi there,
I am currently working on a php framework, which is in some cases structured like the ZendFramework. It has MVC etc. I did not found any equal matching to my problem.
My "problem" is I have a variable number of classes (models, controller), e.g. http_handler. Now I have that much classes I can not set them all manualy into variables.
Can I use $GLOBALS to set a $variableVar?
foreach($classes as $class)
{
include_once($class . '.php');
$GLOBALS[$class] = new $class;
}
Does this create a new variable which will be accessable through the whole code? Example:
//... code
$http_handler->sendRequest($someArgs);
//... code