Hello Phalcon team...
I need to make route as:
https://www.sitename.com/lang/controller
if controller doesnot exists the controller will be as parameter.
my route looks like:
$router = new \Phalcon\Mvc\Router(false);
$router->removeExtraSlashes(true);
$router->setDefaultNamespace('Multiple\Frontend\Controllers');
$router->setUriSource($router::URI_SOURCE_SERVER_REQUEST_URI);
// NEWS ROUTING
$router->setDefaultModule("frontend");
$router->notFound(array(
'module' => 'frontend',
"controller" => "index",
"action" => "show404"
));
$router->add('/', [
'module' => 'frontend',
'controller' => 'index',
'action' => 'index',
])->setName('frontend');
$router->add('/{language:[a-z]{2}}', [
'module' => 'frontend',
'controller' => 'index',
'action' => 'index',
])->setName('frontend-index-lang');
$router->add('/{language:[a-z]{2}}/:controller', [
'module' => 'frontend',
'controller' => 2,
'action' => 'index',
'params' => 2,
])->setName('frontend-controller');
$router->add('/{language:[a-z]{2}}/:controller/:action', [
'module' => 'frontend',
'controller' => 2,
'action' => 3,
'params' =>3,
])->setName('frontend-action');
$router->add('/{language:[a-z]{2}}/:controller/:action/:params', [
'module' => 'frontend',
'controller' => 2,
'action' => 3,
'params' => 4,
])->setName('frontend-params');