I have a problem with routes on phalcon. I have code:
$router->add('/{aliascat:[0-9\-a-z\-]+}(/?)', array(
'module' => 'frontend',
'controller' => 'category',
'action' => 'view',
'category' => 1,
'lang' => 'md',
))->setName('category_view_cpu');
$router->add('/{lang:[' . $langsDefined . ']{2}+}/{aliascat:[0-9\-a-z\-]+}(/?)', array(
'module' => 'frontend',
'controller' => 'category',
'action' => 'view',
'category' => 2,
'lang' => 1,
))->setName('category_view_cpu');
$router->add('/{controller:[a-z]{3,50}+}(/?)', array(
'module' => 'frontend',
'controller' => 1,
'action' => 'index',
'lang' => 'md',
))->setName('default_module');
$router->add('/{lang:[' . $langsDefined . ']{2}+}/{controller:[a-z]{3,50}+}(/?)', array(
'module' => 'frontend',
'controller' => 2,
'action' => 'index',
'lang' => 1,
))->setName('default_module_lang');
$router->add('/{controller:[a-z]{3,50}+}/:action/', array(
'module' => 'frontend',
'controller' => 1,
'action' => 2,
'lang' => 'md',
))->setName('default_module_controller_action');
$router->add('/{lang:[' . $langsDefined . ']{2}+}/{controller:[a-z]{3,50}+}/:action/', array(
'module' => 'frontend',
'controller' => 2,
'action' => 3,
'lang' => 1,
))->setName('default_module_controller_action_lang');
$router->add('/{controller:[a-z]{3,50}+}/:action/:params/', array(
'module' => 'frontend',
'controller' => 1,
'action' => 2,
'params' => 3,
'lang' => 'md',
))->setName('default_module_controller_action_params');
$router->add('/{lang:[' . $langsDefined . ']{2}+}/{controller:[a-z]{3,50}+}/:action/:params/', array(
'module' => 'frontend',
'controller' => 2,
'action' => 3,
'params' => 4,
'lang' => 1,
))->setName('default_module_controller_action_params_lang');
I get undifined controller for category route, because conflict with default_module route. How I can fix this problem?
I have route: /category-name/ And default: /controller/action/...
Conflict with routes.