Module can be considered as a self-contained application within another application. As a result,. it also participates in URL parsing and creation.
In 1.x, all URL parsing and creation are done at the application level. Module has little control about that.
In 2.0, I’m thinking to let module control its own URL parsing and creation. In particular:
- If application url manager is set as GET format, then module url manager is ignored
- If application url manager is set as PATH format, then[list]
- URL creation within the module will be handled by the module URL manager unless it is using GET format.
- When parsing a URL, if the first segment in the path info is a module ID, then[list]
- If the module URL manager is in PATH format, the corresponding module will handle the rest part of the URL parsing. For example, path info ‘comment/x/yz’ will be handled by ‘comment’ module’s url manager which sees ‘x/y/z’ as the path info.
- Otherwise, the application URL manager will continue parsing the URL.
What do you think about this proposal?
This has the benefit of making URL rule management less centric and giving modules more freedom in determining what URL formats to use.
The main drawback is that the module ID is now hardcoded in the URLs. Do you think this is acceptable?