![]() |
Organizing Your Controllers into Sub-folders - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Organizing Your Controllers into Sub-folders (/showthread.php?tid=43236) |
Organizing Your Controllers into Sub-folders - El Forum - 07-05-2011 [eluser]Unknown[/eluser] hi ,please how can i specify the url of the method redirect whet i have this tree : project/application/backoffice/login/controllers/login.php Organizing Your Controllers into Sub-folders - El Forum - 07-05-2011 [eluser]ELRafael[/eluser] I believe that your structure is wrong bejimed. Try to organize like this: Code: project/ You can access with this url: http://example.com/index.php/backoffice/login Try to check this: https://bitbucket.org/wiredesignz/codeigniter-modular-extensions-hmvc/wiki/Home Organizing Your Controllers into Sub-folders - El Forum - 07-05-2011 [eluser]defectivereject[/eluser] i have a CMS My controller folder consists of just folders for each section of the CMS Admin Training HR (e.t.c) then the controllers are within them. Some have one some have 2 or 3. If i wanted the personnel controller in the HR folder it would be http://localhost/project/index.php/hr/personnel/functioninthatcontroller or if you wanted the courses controller in the training folder http://localhost/project/index.php/training/courses/functioninthatcontroller Hoping you were understood correctly Organizing Your Controllers into Sub-folders - El Forum - 07-05-2011 [eluser]ELRafael[/eluser] http://localhost/project/index.php/hr/personnel/functioninthatcontroller For this URL, your structure: Code: - application/ And your personnel.php is something like that: Code: class Personnel extends CI_Controller { IMHO: It's a bit confusing. Why you just set the folder for backoffice? Code: - application/ Now, everytime you need to access your CMS, just put "backoffice" before the controller. If you don't wanna use this, tell me exactly what's wrong with this structure. You can access the controller typing the folder name in the URI ![]() Organizing Your Controllers into Sub-folders - El Forum - 07-05-2011 [eluser]defectivereject[/eluser] nope each controller extends either a MY_Controller, a Public_controller or an Admin_controller then each function within each controller has additional checks for Usertype built in. and it's set in such a way so you know what folder deals with what modules on the CMS. I say CMS but it's more of a business management system. Handles 700 users with 16 access levels and 9 group access levels. as well as 70+ dept levels!!! also if i get run over or die. someone coming in can see it organised a little more efficiently, This folder controls that module, that folder controls that module. Also each folder could then be deleted and have no knock on effect to the rest of the system. Code: class Welcome extends Public_Controller { Code: <?php Organizing Your Controllers into Sub-folders - El Forum - 07-05-2011 [eluser]ELRafael[/eluser] So it's better to use HMVC. I use it here and i'm very happy. I have a folder called modules Code: - application So when i delete modules/hr, the only thing that still exists is the assets. Code: + application/ Organizing Your Controllers into Sub-folders - El Forum - 07-05-2011 [eluser]defectivereject[/eluser] Nah. as you need a full config e.t.c. for each module that way. |