CodeIgniter 3 - Structure of subdirectories - Routes

4

I created a project in CI and I'm going through the following problem: I split my controllers into two folders:

application/controllers/painel/

and

application/controllers/site/

In the subdirectory panel there is the home controller and the site as well.

I wanted to set the home control of the site subdirectory as the default controller. I tried doing this on the routes, putting:

$route['default_controller'] = 'site/home'

and also

$route['default_controller'] = 'site/index/home'

But it did not work, can anyone help me?

    
asked by anonymous 19.01.2017 / 11:25

1 answer

3

In the application/config/routes.php file you need to add a route for each home . It would look like this:

$route['painel'] = "painel/home";
$route['site'] = "site/home";
    
19.01.2017 / 12:01