Welcome Guest, Not a member yet? Register   Sign In
Organizing Your Controllers into Sub-folders
#4

[eluser]ELRafael[/eluser]
http://localhost/project/index.php/hr/pe...controller

For this URL, your structure:

Code:
- application/
  + config/
  - controllers/
    - hr/
      personnel.php
    - trainning/
      courses.php

And your personnel.php is something like that:

Code:
class Personnel extends CI_Controller {

  public function functioninthatcontroller()
  {
    echo 'Hello from hr/personnel/functioninthatcontroller';
  }
}

IMHO:
It's a bit confusing. Why you just set the folder for backoffice?
Code:
- application/
  + config/
  - controllers/
    - backoffice/
      personnel.php  <-- Admin Controller
      courses.php    <-- Admin Controller
    personnel.php    <-- Public Controller
    courses.php      <-- Public Controller

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 Wink


Messages In This Thread
Organizing Your Controllers into Sub-folders - by El Forum - 07-05-2011, 04:59 AM
Organizing Your Controllers into Sub-folders - by El Forum - 07-05-2011, 05:33 AM
Organizing Your Controllers into Sub-folders - by El Forum - 07-05-2011, 09:14 AM
Organizing Your Controllers into Sub-folders - by El Forum - 07-05-2011, 09:26 AM
Organizing Your Controllers into Sub-folders - by El Forum - 07-05-2011, 09:32 AM
Organizing Your Controllers into Sub-folders - by El Forum - 07-05-2011, 09:51 AM
Organizing Your Controllers into Sub-folders - by El Forum - 07-05-2011, 09:53 AM



Theme © iAndrew 2016 - Forum software by © MyBB