Username (e.g. epiz_XXX) or Website URL
epiz_29214392
Error Message
My error/debugging system raises ‘Controller class App\Controllers\Home not found’ from router.php
Other Information
public function dispatch($url)
{
$url = $this->removeQueryStringVariables($url);
if ($this->match($url)) {
$controller = $this->params['controller'];
$controller = $this->convertToStudlyCaps($controller);
$controller = $this->getNamespace() . $controller;
if (class_exists($controller)) {
$controller_object = new $controller($this->params);
$action = $this->params['action'];
$action = $this->convertToCamelCase($action);
if (preg_match('/action$/i', $action) == 0) {
$controller_object->$action();
} else {
throw new \Exception("Method $action in controller $controller cannot be called directly - remove the Action suffix to call this method");
}
} else {
throw new \Exception("Controller class $controller not found");
}
} else {
throw new \Exception('No route matched.', 404);
}
}
My site is based on https://github.com/daveh/php-mvc and works perfectly fine when I’m using it with MAMP locally however it doesn’t find the classes defined within App\Controllers from router.php located in Core. Anyone got any ideas?