CodeIgniter 2 not allowing multi-level subfolders for controllers

Since I read the doc , the controllers in CodeIgniter should support several subfolders of the level, but as far as I tested, it is impossible to work after the first folder of the first level.

Example:

mysite.dev/ (index page, default controller home.php, works)

mysite.dev/admin/ (admin section in admin / home.php works)

mysite.dev/admin/manage/ (in admin / manage / home.php, not working)

I am trying to understand why and how to make it work with several level subfolders?

Thanks in advance!

+4
source share
1 answer

CI allows only one sub-dir level. However, you can emulate this pattern with route files, as @Brendan says:

Controllers

 welcome.php admin/admin.php admin/manage.php 

Route File:

 $route['admin/manage/:any'] = "admin/manage/$1"; $route['admin/admin'] = 'admin/home.php'; 

You can implement some changes in the hard code to get the expected results: http://codeigniter.com/forums/viewthread/190563/

+3
source

Source: https://habr.com/ru/post/1444205/


All Articles