I do not want every time to repeat the router prefix and I want to do it more cleanly So I need another method like this example:
<?php
$ConsoleRouter = new \Phalcon\Mvc\Micro\Collection();
// config global
$NAPP_regex = $this->getShared('config')->project->regex;
$ConsoleRouter
->setPrefix('/console')
->setHandler('\NAppRest\Console\Controllers\ConsoleController')
->setLazy(true);
// Auth Keys
$ConsoleRouter->setPrefix('/console/apps/keys');
$ConsoleRouter->get ("/{id:$NAPP_regex}", 'getProjectKeys');
$ConsoleRouter->post ("/{id:$NAPP_regex}", 'getProjectKeys');
$ConsoleRouter->get ("/{id:$NAPP_regex}/create", 'createProjectKey');
$ConsoleRouter->post ("/{id:$NAPP_regex}/create", 'createProjectKey');
// Tables
$ConsoleRouter->setPrefix('/console/apps/tables');
$ConsoleRouter->get ("/{id:$NAPP_regex}", 'getProjectTables');
$ConsoleRouter->post ("/{id:$NAPP_regex}", 'getProjectTables');
return $ConsoleRouter;