Controllers in two level subdirectory
Is there any hack to provide two level sub directory contro开发者_运维百科llers support ?
Well, I'll supply with extending the controller.
Copy this code into your CI application library folder (the default is /system/application/libraries), and name it as MY_Router.php
Not without modifying the core. Although, I'm not sure as why you would need to?
I would suggest that you focus on routes instead: http://codeigniter.com/user_guide/general/routing.html
By having one level subfolders in system/application/controllers you could with easy, by adding an URI route, make system/application/controllers/my_sub_level accessable trough http://example.com/myfirstlevel/mysecondlevel/mythirdlevel/my_sub_level by adding this route:
$route['myfirstlevel/mysecondlevel/mythirdlevel/my_sub_level/:any'] = "my_sub_level/welcome";
精彩评论