![]() |
Arrange Controllers in Sub Folders - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Arrange Controllers in Sub Folders (/showthread.php?tid=36237) |
Arrange Controllers in Sub Folders - El Forum - 11-26-2010 [eluser]Unknown[/eluser] Hi, I know CI allows us to arrange our controllers in sub folders. That is nice. Is it possible to arrange the controllers in Sub-Sub-Folders and deeper? If yes, how? If no, what is the alternative? Extra Info: I want to have my folder structure as follows: controllers/shop/products.php controllers/shop/customers.php Controllers/shop/admin/login.php Controllers/shop/admin/products.php and controllers/jobs/vacancies.php controllers/jobs/seekers.php Controllers/jobs/admin/login.php Controllers/jobs/admin/applications.php and More folders and then more sub folders... Arrange Controllers in Sub Folders - El Forum - 11-26-2010 [eluser]InsiteFX[/eluser] CodeIgniter only allows to go one folder deep! If you need more you can look into modules using the WIKI HMVC. InsiteFX Arrange Controllers in Sub Folders - El Forum - 11-26-2010 [eluser]reidz[/eluser] im overiding Router library in CI with this code, used this code as your own library then solved sorry i forgot from where i got this code, so credit goes to original coder Code: <?php hope it works for you Arrange Controllers in Sub Folders - El Forum - 11-26-2010 [eluser]InsiteFX[/eluser] Personally, I would use HMVC keeps your code nice and neat! InsiteFX Arrange Controllers in Sub Folders - El Forum - 11-26-2010 [eluser]Unknown[/eluser] Thanks @reidz It really works. Here is how to use the code: Created a file named MY_Router.php in the application/libraries/ and paste the code into it. That is it! [quote author="reidz" date="1290799391"]im overiding Router library in CI with this code, used this code as your own library then solved sorry i forgot from where i got this code, so credit goes to original coder Code: <?php hope it works for you[/quote] |