I want to group routes:
$userGroup = new \Phalcon\Mvc\Router\Group('user');
$app->map('/user/login', function () {
// code...
})->setName('user.login')->setGroup($userGroup);
And I retrieve the information:
// get route name
$routeName = $app->router->getMatchedRoute()->getName();
// get group name <- work , but I do not like getPaths()
$groupName = $app->router->getMatchedRoute()->getGroup()->getPaths();
//but getRoutes() NOT WORK.
$groupName = $app->router->getMatchedRoute()->getGroup()->getRoutes();
I implement something that helps to group routes, and so to separate code into different files and folders.
any ideas?