I have 2 modules: module1 and module2.
Both have their repsective routing set up as follows:
addRoute(pattern="/", handler=“module**[1 or 2]**”,action=“index”);
…
addRoute(pattern="/:handler/:action?");
I want to go from module1 to module2, making the layout similar to the ones in module1. For that I’d make another handler, that employs logic similar to the main handler for module2, but in context on module1 (think of a “change settings page” for developers (quick and dirty with more functionalities, and a similar page for end users). So I have a main.cfc handler and a module1.cfc handler in module2. I can easily go to module1.cfc by redirecting to index.cfm/module2/module1.
But I don’t want this. Think of it being index.cfm/settings (being the entrypoint for the settings module) and index.cfm/admin (being the entrypoint for the admin module). It would be like redirecting to index.cfm/settings/admin.
I want the URL to be index.cfm/admin/settings. I can add a route like this:
addModuleRoutes(pattern="/module2",module=“module2”);
But this would result in the same handler, layout, views etc as the normal index.cfm/module2.
What I’m basically asking is: is there a handler argument available for the addModuleRoutes, or is there any other way of making a route that would employ the correct handler?
best regards,
Mikaël