CI only allows controllers one subfolder deep |
[eluser]tapan.thapa[/eluser]
Hello Community, I am stuck at my coding stage in between while i have created multiple sub folders inside controller folder. My folder structure is: application->controllers->admin->gallery->audio->(In this folder i have subcategory.class). If i try to invoke http://localhost/abcd/admin/gallery/audi...tegory/add the i am getting page 404. I got to know from internet that CI only allows controllers one subfolder deep. Is it true? I am using CI 2.1.3. Kindly confirm if this is true so that i can restructure my code accordingly or if i am doing any mistake do let me know the solution. :-( Thanks & Regards Tapan Thapa
[eluser]boltsabre[/eluser]
There is a way to do it, I cannot remember how to do it off the top of my head, just try google with something like (sorry, I'm at work and don't have any of my CI code here) "codeigniter how to nest folders inside controller folders" "codeigniter subfolders in controller folders" Should give you something. I think I remember that it can get a bit more tricky if you are using hmvc... ??? Also, depending on what you are trying to achieve, $routes may work for you (ie, if you want a certain "url structure" but cannot map it physically with your controller folders you can simply route it to your desired URL pattern.
[eluser]tapan.thapa[/eluser]
Hello, Thanks for your reply. I already searched google before hitting forum and i got some custom class through which i can resolve my issue however i would like to know if by default CI only gives nesting up to single folder. Regards Tapan Thapa
[eluser]boltsabre[/eluser]
By default, last time I checked, yes, you cannot have more than one folder deep in your controller, you will have to either extend the base class/library that handles this, or go for a class already built. Sorry I cannot be of more help, I hope this helps somewhat. |
Welcome Guest, Not a member yet? Register Sign In |