Organizing Your Controllers into Sub-folders |
[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
[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/codeig.../wiki/Home
[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/pe...controller or if you wanted the courses controller in the training folder http://localhost/project/index.php/train...controller Hoping you were understood correctly
[eluser]ELRafael[/eluser]
http://localhost/project/index.php/hr/pe...controller 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 ![]()
[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
[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/
[eluser]defectivereject[/eluser]
Nah. as you need a full config e.t.c. for each module that way. |
Welcome Guest, Not a member yet? Register Sign In |