0

I have created this flow in codeigniter: Controller: Employee Sales Account

Now if i am accessing Sales Controller Function in View then i am doing like: base_url()/Employee/Sales/FunctionName Then its throwing 404 error.

Can anyone tell me how can i manage Sub-Sub Folder Structure in Code Igniter

  • Your question is not clear @Surbhi Gupta, please provide more details. – sauhardnc May 09 '20 at 13:34
  • I have created a controller inside:
    1. controller
       1.1 employee
             1.1.1 sales
             1.1.2 account
             1.1.3 project
             
    
    now if i want to access function of any sub-sub folder controller then how can i process, its showing 404
    – Surbhi Gupta May 09 '20 at 13:38
  • By default, CodeIgniter routing is `contoller_folder_name/controller_name/function_name`, so when you write `employee/sales/account` it will search for `account function` in `sales` controller inside `employee` folder, thus the `404` page. In my opinion, you should make all the folders subfolders of `controller`. But if you must, you'll have to extend default `router` behaviour, which is not a very good idea IMO. See here, for more info - https://degreesofzero.com/article/controllers-in-sub-sub-folders-in-codeigniter.html – sauhardnc May 09 '20 at 13:58
  • also have a look here: https://stackoverflow.com/questions/13955335/routing-controllers-in-subfolders-using-codeigniter – Vickel May 09 '20 at 16:11

0 Answers0