I try to create application with structure:
\app\controllers\ \app\controllers\api\
in api folder I want to put my api controlles. And I want request url: localhost/api/apicontroller/method that run specified api method. How I understand I need use phalcon routes but I don't understand how. I try something like this (but it not work):
$di->set('router', function() {
$router = new Phalcon\Mvc\Router();
$router->add('/api/contoroller/method', array("controller" => "api\contoroller", "action" => "method"));
return $router;
});
I now, that phalcon support modules (https://docs.phalcon.io/en/latest/reference/routing.html#routing-to-modules) but it's not what I need.
Thanks!