From my understanding of MVC implementations, the default URL mapping is:
/controller/action/parameters
But with Yii, it’s also to do this:
/module/controller/action/parameters
However, neither gives me what I want as it’s being hard coded(?). I want to have dynamic URL mapping where:
/department/IT/forum/post/edit/5324
and
/department/Marketing/forum/post/edit/3256
will get the same module ‘forum’ which will handle all relevant requests within that module. The only difference is that the ‘forum’ module will enforce RBAC. However, after reading part of the documentation [1], I’m still unclear if this is possible in Yii. Would someone please point me in the right direction if this is achievable? I’d rather not roll my own framework
Thanks for the fast reply. I apologize for not being clear enough in what I’m after. The sample /department/{name}/ is just a for example. The preceding part of the URL prior to ‘forum’ is completely dynamic and is definable by the user (of the application) such as
will still point to the same ‘forum’ module. I’d figure that the URL will be in the DB to ensure no conflicts and at which point it’s invoking the appropriate module. Note that the ‘region’ and ‘department’ could be its own module and/or controller, which is like nesting and/or interdependency of modules and/or controllers. The whole concept is being agile… I just make the modules. The user defines where and who has access to them for a given URL.
Yup, 99% user configurable! Anyway, I’ve found this by accident and was wondering if I can make it work for me by calling the appropriate module for a given URL via custom URL rule class [1]. What do you think? Thanks again.