I think you've correctly understood what I'm trying to achieve. So the issue must be arrising then because I'm using custom routes so that I can do camelizing for the module and the action:
$router->add('/:controller/([a-zA-Z\-]+)/:params', array(
'module' => 'apiV1',
'controller' => 1,
'action' => 2,
'params' => 3
))->convert('action', function ($action) {
if(!empty($action) && strpos($action, '-') !== False)
{
return lcfirst(Phalcon\Text::camelize($action));
}
else
{
return $action;
}
})->setName('C');
$router->add('/:module/:controller[/]', array(
'controller' => 2,
'module' => 1,
))->convert('module', function ($module) {
if(!empty($module) && strpos($module, '-') !== False)
{
return lcfirst(Phalcon\Text::camelize($module));
}
else
{
return $module;
}
})->setName('B');
$router->add('/:module[/]', array(
//'controller' => 'index',
'module' => 1
))->convert('module', function ($module) {
if(!empty($module) && strpos($module, '-') !== False)
{
return lcfirst(Phalcon\Text::camelize($module));
}
else
{
return $module;
}
})->setName('A');
$router->add('/:module/:controller/([a-zA-Z\-]+)/:params', array(
'module' => 1,
'controller' => 2,
'action' => 3,
'params' => 4
))->convert('action', function ($action) {
if(!empty($action) && strpos($action, '-') !== False)
{
return lcfirst(Phalcon\Text::camelize($action));
}
else
{
return $action;
}
})->convert('module', function ($module) {
if(!empty($module) && strpos($module, '-') !== False)
{
return lcfirst(Phalcon\Text::camelize($module));
}
else
{
return $module;
}
})->setName('D');