Hello,
I'm new to phalcon and I'm asking myself if this behavior is "usual" - to me it looks like a bug:
/**
* Registering a router
*/
$di['router'] = function() {
$router = new Router();
$router->setDefaultModule("frontend");
$router->setDefaultNamespace("Myspace\Frontend\Controllers");
$router->addGet("/api1/:action", array(
'module' => 'frontend',
'controller' => 'api',
'action' => 1
));
$router->addGet('/', array(
'module' => 'frontend',
'controller' => 'index',
'action' => 'index'
));
return $router;
};
When the first route is called with correct parameters, I receive the following error mesesage:
- Myspace\Frontend\Controllers\Api1Controller handler class cannot be loaded
Which is correct, because I expect "ApiController" to be loaded instead of "Api1Controller"(see documentation: https://docs.phalcon.io/en/latest/reference/routing.html#parameters-with-names ). Am I missing something? Can't believe routing is faulty at this level.