Nested modules and modular structure

hey, guys,

I’m trying to make my application in modules but i’m a bit confused abou the structure and commands to create nested modules

I wanna have something like this:

Application / modules / kcore =>front end of core components

Application / modules / kcore / modules / backend => backend to manage the module

Application / modules / kpoll => elements of frontend

Application / modules / kpoll / module / backend => backend to manage polls

Application / modules / kguestbook = > the guestbook frontend

Application / modules / kguestbook / modules / backend => to manage guestbook

My questions:

  • Is it possible to build this structure by using yiic shell ?

  • Can I have "backend" nested modules inside every module?

  • Do you guys have any suggestions?

Thanks in advance


thanks for all help!


Please, scoob.junior, which were the solution you applied?

Hi, Nacesprin!

Well, a little time has been past since i started this topic, so some things are different now in my project. However, just to share with you guys what happened:

First answering my own questions:

  • Is it possible to build this structure by using yiic shell ?

== Not at all, the further i reached was creating individual modules and moving them inside another module

  • Can I have "backend" nested modules inside every module?

== Perfectly, it works like a charm

The application was working fine with this structure, but i couldn’t find an access control extension which works in a very good way with modules and submodules.

I decided to simplify the structure and create controllers for backend prefixing them with the word "Back", so i can keep them in the same folder of frontend controllers (no need of submodules). Views are stored in folders prefixed with "back" word also.

Now i’m using SRBAC module to manage the access control and my application structure looks like the following:





      |  |__UserLogin.php

      |  |__views/

      |     |__userLogin.php



      |  |__BackUserController.php

      |  |__UserController.php

      |  |__BackBannerController.php

      |  |__BannerController.php







Many thanks to Schmunk, who gave me good suggestions during the development of such structure.

Hope this helps!



Hi scoob.junior

This is very helpful and it help me!

Thanks very much for your time!

Glad that i could help!


I am new to yii framework. I have to make an enterprise level product based on modular structure. Can you please tell, where you have place the Active Record(Model) folder and use of Component Folder