It has long been trying to solve their problem: I have the basic configuration is the site configs modules, i.e. I want to connect the module and configuration module that automatically connects to the system. In the lessons described this method: http://www.yiiframew…oc/cookbook/32/ but it does not fit me because it is known in advance how many will be configuration, but in my case is not known, and I use this code in conf_hard.php (this is main config file):
Nono, my question is: why combining arrays would cause setting CWebApplication.urlManager? It should be pure array manipulation. Why would it involve CWebApplication object here?
Maybe I misunderstand, but the array urlManager sets the basic rules of uri, but in the configuration of modules urlManager sets the path for this specific module.
In this, my main problem, it is desirable that all uri rules comes with the module itself, so to me and should have urlManager in one config and in the other.
For URL rules, they should be put in the same place, or at least, there is a central place to aggregate the rules scattered in other places. The reason is that when parsing URLs, Yii needs to have the complete list of URL rules so that it can identify which rule to apply.
For your problem, you may consider in your main app config, add:
where urlRules.php is responsible to aggregate all module URL rules into a single big array.
urlRules.php could be as simple as returning an array of URL rules.
In your case, since you want to let each module has its own URL rule set, you may store each module rule set in a separate file, and then write a piece of code in urlRules.php to combine them and return them as a single array of rules.