Using named parameters on the standard router I get a default value equal to the position, when it's not defined:
$router->addGet("/api/:module/([a-zA-Z0-9_-]+)(/json|/csv)*", array(
'module' => 1,
'controller' => 'index',
'action' => 'view',
'element' => 2,
'type' => 3,
'api' => true
));
api/user/1 ==> 3 // I don't want the 3 to be shown, the parameter is not set
api/user/1/json ==> '/json'
using
$dispatcher->getParam('type')
The problem comes when I try to parse the "type" parameter, I must check it vs the value 3, but in other routes I will have it as the second parameter so....
How can I accomplish this?