Welcome Guest, Not a member yet? Register   Sign In
How to create multiple folders to organize a big project?
#1

[eluser]Marcelo Reborn[/eluser]
I've saw other topics with the aparently the same question, but mine is different.


I'm starting a big project, it'll have more than 20 modules, each module with more than 10 classes...

In controller folder was thinking in create one module folder, and inside it another sub-folders, but CI accept only one sub-folder.

I don't know the best way to do that, someone can help?
There's a attached image, representing an example.

Thanks!
#2

[eluser]nelson.wells[/eluser]
I haven't used it personally, but I think HMVC is exactly what you want. Look in the wiki for it (it may be titled Modulate Extensions there).
#3

[eluser]Marcelo Reborn[/eluser]
Hi Nelson,

I used the term "module", but it just about folder organization, isn't a CI module or extension.

I simply need to be able to use 2 or more levels of sub-folders in Controller.
#4

[eluser]Jelmer[/eluser]
That's pretty much what HMVC comes down to, look into it at http://codeigniter.com/wiki/Modular_Separation/

There's not much documentation (actually very very little) but looking through the code it's not hard to understand how it works.

You'll be able to group certain controllers with their own libraries, helpers, views, configs and language files and you'll be able to have some libraries, helpers, views, configs and language files available to all. That's probably exactly what you need to organize your project and still know what part you're working with.

In the end with modular seperation it still works like normal, you'll just have some extra folders for controllers, libraries, etc...

Another option is of course to break up your project in different applications but that has the serious downside that you can only share resources by putting them in a shared system folder.
#5

[eluser]Marcelo Reborn[/eluser]
Thanks for the link, Jelmer!

I was confused, "Modular Extensions" and "Modular Separation" are 2 tricky words! Tongue

I'll try it another time, I'm busy with other things right now... but can you tell me if this Modular Separation was developed by EllisLab/CI or is it a user contributed add-on?

I'm just thinking about future of my project, if it will supported on later versions of CI, etc.
#6

[eluser]Jelmer[/eluser]
It was created by wiredesignz and is maintained by Phil Sturgeon who has already updated it to work with the CI2.0 alpha code. It works by extending the Router and Loader classes, neither of which is a huge hack or anything.
Also as elegant as the code works, it isn't diffucult to understand - so updating and maintaining it specificly for your own application might also be an option.

Phil's the guy begind PyroCMS and is probably among the most active users. He also mentioned on his blog that Derek Allard told him that while modular seperation isn't in the planned features for CI2 it is on EllisLabs radar.
Bottom line: if you need it, use it. It's among the most used extentions so getting support shouldn't be a problem and there will probably be continuity for a long time to come.




Theme © iAndrew 2016 - Forum software by © MyBB