hi.
i am currently developing my own framework and i ran into some trouble.
let's say i have a var
$controller = "default";
the contents of $controller is read from a config file, so it changes it's value automatically.
I also have an object, called "defaultController".
I want this object to be created automatically when $controller = "default".
How can i do this ?
What i am trying to do is when $controller is "default", it creates defaultController, if $controller is "admin", it creates adminController etc.
I've seen this behaviour in Zend Framework, but i have no idea how to implement it in my framework.
Thanks.
lol, this is built in right in PHP, an example of this could be:
$controller="default";
$objname = $controller."Controller";
$obj = new $objname;