Exploit
Exploit

Reputation: 6386

codeigniter modules for backend , frontend, members, etc

i'm going to be creating a complex ecommerce application and wanted to know if setting each login panel and area as a module into CI.

for example:

application
modules/
- backend/
-- config
-- controllers
-- models
-- views

- frontend/
-- config
-- controllers
-- models
-- views

- members/
-- config
-- controllers
-- models
-- views

if this method is a bad idea how else would it be done that will let me organise all the controllers, models, and views for each login panel.

Upvotes: 0

Views: 4186

Answers (2)

Sam
Sam

Reputation: 376

you have to use HMVC (hierarchy of parent-child MCV layers) here, to setting up HMVC in CodeIgniter you need to visit the links

  1. http://net.tutsplus.com/tutorials/php/hvmc-an-introduction-and-application/
  2. https://bitbucket.org/wiredesignz/codeigniter-modular-extensions-hmvc/wiki/Home

Upvotes: 0

Nicolás Torres
Nicolás Torres

Reputation: 1345

You should stick to the MVC pattern, that would mean having controller inside de controller folder, same with models and views.

You can still use sub folders to organize the files.

With your approach you have to modify and adapt CI to the new structure which means having future problems if you want to upgrade or even means having difficulties solving future errors, since your CI has been modified.

If you think it's worth it then do it,lets say because your project is big and you need it to be organized that way, then do it; There's nothing that can't be done here.

Upvotes: 1

Related Questions