mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-06-17 00:37:52 +00:00
fix for __invoke methods (if there are only in class (Action))
This commit is contained in:
@@ -109,6 +109,10 @@ abstract class Route implements IRoute
|
||||
$router->debug('Loading class %s', $className);
|
||||
$class = $router->getClassLoader()->loadClass($className);
|
||||
|
||||
if (count($controller) === 1) {
|
||||
$controller[1] = '__invoke';
|
||||
}
|
||||
|
||||
$method = $controller[1];
|
||||
|
||||
if (method_exists($class, $method) === false) {
|
||||
|
||||
Reference in New Issue
Block a user