Yeah, I'm fairly certain a module is what I want, although I am new to Yii, so I could easily be mistaken. Let me explain the application.
Inside the index file, instead of pulling the configuration from a static config file, it connects to a database and grabs information on the site based on the domain that was used to access the site. It pulls everything from site name, to the dsn so it knows which database to connect to. It also pulls from a database table what modules should be enabled. It then generates the config file to be loaded into the application.
The whole system is a cms of sorts, that hosts several domains using the same codebase, with just different configuration and themes per domain. Different domains have different modules enabled. For example, one domain might need a Blog module, and another might need the Gallery module, and even another might need both.
Currently I have an Admin module that contains the admin section of the sites, with things like admin management, and a general admin area. This Admin module contains other modules, like Blog, Gallery, etc for managing different areas of the site. The Blog module should hopefully be able to tell the admin module about some navigation that it has, like a navigation link to add a new blog post, or to manage comments. I was hoping to be able to have the Blog module itself define what navigation items it has, in something similar to the init() function, but since when you are in the Gallery module inside the Admin module the Blog module never gets loaded, this presents a problem.
If I really have to, I guess In the Admin layout template, I can go through and see if a module is enabled, and show it's navigation. But I was hoping for something a little more dynamic than that, so that each Module can be 100% self contained, and affect the Admin module around it, or even other modules inside the Admin module. For example, it would be cool if the Blog module could tell a Dashboard module that there are new posts. But the Dashboard module would hopefully be able to accept messages from any module, and should have no knowledge of the modules, just information that is passed to it.
I hope that makes sense.
On a related note, i can do Yii::app()->getModule('admin') and get a reference to the admin module, but how can i get a reference to modules inside a module?
Yii::app()->getModule('admin/dashboard/stats') returns null.