I want to change the default route on my application to use an optional parameter via Bootstrap.php, not in the application.ini. I am having trouble setting up all "escape" routes, I even don't know If I need to set up several routes or if I can do with only one!
The route must be something like
":module/:area/:controller/:action"
where :area is optional and defaulted to "public"
So in any access to http://www.example.com/my_module/my_controller/my_action I can get via a FC plugin the following:
$request->getParam('area') = "public"
And in http://www.example.com/my_module/my_area/my_controller/my_action I get:
$request->getParam('area') = "my_area"
The main trouble is creating all routes so it escapes to default module, index controller and index action in case those are not passed too and loading http://www.example.com/ returns same as http://www.example.com/default/public/index/index.
And I want to use URL Helper to generate internal URLĀ“s and it respects the correct assembly on this new Default Route.
Edit: I figured that default Route comes with a fail-safe for the module, if it don't exist it defaults to the controller, but how to mimic similar behavior for other parts of the URL and the module itself when creating it in the Bootstrap.
Can anybody give me some light or suggest where can I find an working example ?