I am working on a simple router program in PHP. Here is my function
private function dispatch($dest)
{
$goto = explode("@", $dest);
$controller = $goto[0];
$action = $goto[1];
$clocation = require_once("../app/controllers/$controller.php");
$c = new $controller;
}
Everything works to that point. But, I want to return the results of the action (a method within the class that is instantiated as $c. I tried :
return $c->$action
but that doesn't work. Is there a way to do this, or do I need to try a different approach all together?
thanks
()so it think its a property