[FEATURE] Added ressource controller type

This commit is contained in:
Simon Sessingø
2015-10-06 19:46:07 +02:00
parent 6354c3c766
commit cbe1af0ab9
5 changed files with 99 additions and 12 deletions
+1 -4
View File
@@ -181,12 +181,9 @@ abstract class RouterEntry {
} else {
// When the callback is a method
$controller = explode('@', $this->getCallback());
$className = $this->getNamespace() . '\\' . $controller[0];
$class = $this->loadClass($className);
$method = $requestMethod . ucfirst($controller[1]);
$method = strtolower($requestMethod) . ucfirst($controller[1]);
if (!method_exists($class, $method)) {
throw new RouterException(sprintf('Method %s does not exist in class %s', $method, $className), 404);